interface TextFieldProps

Passed to TextField by a form that holds a string field.

Type Parameters

T extends FieldValues

Properties

name: Path<T>
optional
label: string
optional
labelAction: ReactNode

Shown at the right of the label, such as a reset button.

optional
type: "text" | "email" | "password" | "url" | "search"
optional
placeholder: string
optional
autoComplete: string
optional
autoFocus: boolean
optional
disabled: boolean
optional
rules: RegisterOptions<T, Path<T>>
optional
maxLength: number

Stops the typing at this length, through the input's own maxLength. Unlike RichTextField's, it adds no rule, so a value set from code isn't checked.

optional
showCount: boolean

Shows an n / maxLength counter, only when maxLength is set.

Usage

import { type TextFieldProps } from "src/components/form/TextField.tsx";