Combine labels, controls, and help text to compose accessible form fields and grouped inputs.
❯buridan add fieldUse the following to build the Field component.
from components.ui.field import fieldFor manual installation, copy each of the source codes below in their respective locations.
A single control with label, helper text, and validation.
field.root
├── field.label
├── Input / Textarea / switch.root / select.root
├── field.description
└── field.error
Related fields in one group. Use field.separator between sections when needed.
field.group
├── field.root
│ ├── field.label
│ ├── Input / Textarea / switch.root / select.root
│ ├── field.description
│ └── field.error
├── field.separator
└── field.root
├── field.label
└── Input / Textarea / switch.root / select.root
Semantic grouping with a legend and description, usually containing a field.group.
field.set
├── field.legend
├── field.description
└── field.group
├── field.root
│ ├── field.label
│ ├── Input / Textarea / switch.root / select.root
│ ├── field.description
│ └── field.error
└── field.root
├── field.label
└── Input / Textarea / switch.root / select.root
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.
Demonstrates field.root, field.group, field.set, field.label, field.description, and field.error composed together.
Props used: orientation on field.root; variant on field.legend; html_for on field.label; data_invalid on field.root.
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.
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.
field.root(
field.label("Email", html_for="email"),
input(id="email", type="email", aria_invalid="true"),
field.error("Enter a valid email address."),
data_invalid="true",
)
Container that renders a semantic fieldset with spacing presets.
field.set(
field.legend("Delivery"),
field.group(),
)
Legend element for a field.set. Switch to the "label" variant to align with standard label sizing.
field.legend("Notification Preferences", variant="label")
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.
Layout wrapper that stacks field.root components and enables container queries for responsive orientations.
field.group(
field.root(),
field.root(),
class_name="@container/field-group flex flex-col gap-6",
)
The core wrapper for a single field. Provides orientation control, invalid state styling, and spacing configurations.
field.root(
field.label("Remember me", html_for="remember"),
switch.root(id="remember"),
orientation="horizontal",
)
Flex column that groups control and descriptions when the label sits beside the control. Not required if you have no layout description block.
field.root(
checkbox.root(id="notifications"),
field.content(
field.label("Notifications", html_for="notifications"),
field.description("Email, SMS, and push options."),
),
)
Label styled for both direct inputs and nested field child items.
field.label("Email", html_for="email")
Renders a standalone title with matching label typography properties inside a field.content node block.
field.content(
field.title("Enable Touch ID"),
field.description("Unlock your device faster."),
)
Helper text slot that automatically line-balances lengthy strings cleanly when utilized inside horizontal configurations.
field.description("We never share your email with anyone.")
Visual divider rule used to separate sections or categories inside a wrapping field.group component. Accepts optional inline children contents.
field.separator("Or continue with")
Accessible error notification typography container block configured automatically with standard application state layout variables (role="alert").
field.error("Invalid passcode combination provided.")