Field
Combine labels, controls, and help text to compose accessible form fields and grouped inputs.
Installation
Copy the following code into your app directory.
Command
Command
Manual
Manual
uv
Composition
field.root
A single control with label, helper text, and validation.
field.group
Related fields in one group. Use field.separator between sections when needed.
field.set
Semantic grouping with a legend and description, usually containing a field.group.
Anatomy
Use the following composition to build a Field component.
field.root is the core wrapper for a single field.
field.content is a flex column that groups label and description. Not required if you have no description.
Wrap related fields with field.group, and use field.set with field.legend for semantic grouping.
Examples
General
Responsive Layout
Vertical fields: Default orientation stacks label, control, and helper text—ideal for mobile-first layouts.
Horizontal fields: Set orientation="horizontal" on field.root to align the label and control side-by-side. Pair with field.content to keep descriptions aligned.
Responsive fields: Set orientation="responsive" for automatic column layouts inside container-aware parents.
Validation and Errors
Add data_invalid="true" to field.root to switch the entire block into an error state.
Add aria_invalid="true" on the input itself for assistive technologies.
Render field.error immediately after the control or inside field.content to keep error messages aligned with the field.
API Reference
field.set
Container that renders a semantic fieldset with spacing presets.
field.legend
Legend element for a field.set_. Switch to the "label" variant to align with standard label sizing.
The field.legend has two variants: legend and label. The label variant applies standard input label sizing and alignment, which is useful if you are stacking nested fieldsets.
field.group
Layout wrapper that stacks field.root components and enables container queries for responsive orientations.
field.root
The core wrapper for a single field. Provides orientation control, invalid state styling, and spacing configurations.
field.content
Flex column that groups control and descriptions when the label sits beside the control. Not required if you have no layout description block.
field.label
Label styled for both direct inputs and nested field child items.
field.title
Renders a standalone title with matching label typography properties inside a field.content node block.
field.description
Helper text slot that automatically line-balances lengthy strings cleanly when utilized inside horizontal configurations.
field.separator
Visual divider rule used to separate sections or categories inside a wrapping field.group component. Accepts optional inline children contents.
field.error
Accessible error notification typography container block configured automatically with standard application state layout variables (role="alert").