Field
Live example
Field
Installation
npx shadcn@latest add https://hextech-ui.vercel.app/r/field.jsonAPI reference
These are the main Field options. See the exported TypeScript types for inherited native or primitive props.
| Prop | Type | Default |
|---|---|---|
label | string (TextField required) | — |
description / error | string (TextField) | — |
name / invalid | Base UI field props | — |
orientation | vertical | horizontal | responsive | vertical |
Validation and forms
Use FieldLabel, FieldDescription and FieldError inside Field so labels and messages remain associated with the control. Set invalid for an external validation error. The default label-to-control gap is 8px.
See Forms for a complete React Hook Form and Zod example with submission, reset and server errors.