ComponentsField
Field
Groups a form control with its label, supporting description, and validation message.
Installation
bunx @swift-rust/ui add field
Usage
tsx
1import { Field, FieldDescription, FieldError, FieldLabel } from "@/components/ui/field";23import { Input } from "@/components/ui/input";45<Field>6<FieldLabel htmlFor="email">Email</FieldLabel>7<Input id="email" type="email" />8<FieldDescription>We will only use this for receipts.</FieldDescription>9<FieldError>Please enter a valid email.</FieldError>10</Field>
Composition
Field is composed of these parts:
FieldGroup└── Field├── FieldLabel├── Control├── FieldDescription└── FieldError