FormFieldProps
Props for the FormField component
Param
Label for the form field
Param
Current value of the input field
Param
Callback function to handle value changes
Param
Type of the input field
Param
Placeholder text for the input field
Param
Error message to display
Param
Minimum value for number inputs
Param
Maximum value for number inputs
Param
Number of rows for textarea inputs
Param
Options for select inputs
Param
Regex pattern for input validation
Param
HTML autocomplete attribute value
Properties
autoComplete?
optional autoComplete: string;
HTML autocomplete attribute value
error?
optional error: null | string;
Error message to display
label
label: string;
Label for the form field
max?
optional max: number;
Maximum value for number inputs
min?
optional min: number;
Minimum value for number inputs
onChange()
onChange: (value) => void;
Function to call when the value changes
Parameters
| Parameter | Type |
|---|---|
value | string | number |
Returns
void
options?
optional options: {
label: string;
value: string;
}[];
Options for select inputs
label
label: string;
value
value: string;
pattern?
optional pattern: string;
Regex pattern for input validation
placeholder?
optional placeholder: string;
Placeholder text for the input field
rows?
optional rows: number;
Number of rows for textarea inputs
Default
3
type?
optional type: "number" | "select" | "textarea" | "text" | "tel" | "email" | "password";
Type of the input field
Default
'text'
value
value: string | number;
Current value of the input field