UIComponentsReact
A form control with its label, description and error, wired together.
Built on the headless Field.See its API in Docs
Rendered by React 19.3.1
Installation
npx shadcn@4.23.0 add https://hamur.dev/r/react/field.jsonIt also adds utils, label, separator. The app needs its setup first: Installation.
Usage
Wrap a control in Field with a FieldLabel, a FieldDescription and a FieldError; the Field labels the control, describes it and shows the error when it is invalid. FieldSet and FieldLegend group fields, FieldGroup stacks them.
import {
Field,
FieldLabel,
FieldDescription,
FieldError,
FieldGroup,
FieldLegend,
FieldSeparator,
FieldSet,
FieldContent,
FieldTitle,
} from '@/components/ui/field'Examples
API reference
The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Field's API reference.