Renders a one-line text field bound to react-hook-form, for the account forms, a dump's title and a playlist's.
f
TextField<T extends FieldValues>(unnamed 0: TextFieldProps<T>): React.JSX.Element
Renders the input with its label and the field's error. It must sit under a
react-hook-form FormProvider, such as one given useApiForm's result.
I
TextFieldProps
Passed to TextField by a form that holds a string field.
- autoComplete: string
- autoFocus: boolean
- disabled: boolean
- label: string
-
labelAction: ReactNode
Shown at the right of the label, such as a reset button.
-
maxLength: number
Stops the typing at this length, through the input's own
maxLength. UnlikeRichTextField's, it adds no rule, so a value set from code isn't checked. - name: Path<T>
- placeholder: string
- rules: RegisterOptions<T, Path<T>>
-
showCount: boolean
Shows an
n / maxLengthcounter, only whenmaxLengthis set. - type: "text" | "email" | "password" | "url" | "search"
Usage
import * as mod from "src/components/form/TextField.tsx";