
Form field with label, description, error message, and validation.
npx shadcn@latest add https://ui.edbn.me/r/field.jsonGroups all parts of the field. Renders a div element.
namestringField name
disabledbooleanfalseDisable field
invalidbooleanInvalid state
validatefunctionCustom validation function
validationMode'onSubmit' | 'onChange' | 'onBlur''onSubmit'When to validate
validationDebounceTimenumber0Validation debounce delay
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-disabled | Present when field is disabled |
| data-valid | Present when field is valid |
| data-invalid | Present when field is invalid |
| data-dirty | Present when value has changed |
| data-touched | Present when field has been touched |
An accessible label for the field control. Renders a label element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-disabled | Present when field is disabled |
| data-valid | Present in valid state |
| data-invalid | Present in invalid state |
The form control to label and validate. Renders an input element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
Additional information about the field. Renders a p element.
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
An error message displayed when validation fails. Renders a div element.
matchstring | string[] | RegExpError rule to match
classNamestring | functionCSS class name
renderReactElement | functionCustom render function
| Attribute | Description |
|---|---|
| data-starting-style | Present when error is animating in |
| data-ending-style | Present when error is animating out |