Field

Data input

A form field: Field holds a Field.Label, one control (Input …) and an optional Field.Description and Field.Error. It wires them for you: the label points at the control, the description and a shown error describe it, and a shown error (or invalid) marks it aria-invalid. disabled disables the control. Field.Set with a Field.Legend groups related fields; Field.Group stacks fields; orientation puts the label beside the control.

import { Field } from '@limerdev/zest';
Field for AI tools (llms.txt)
Use for
Every labelled form control, so labels, help text and errors are announced with it.
Don't
Setting id, for, aria-describedby or aria-invalid by hand inside a Field: it does that. More than one control in a Field: use one Field per control, in a Field.Group. Error text in a Field.Description: use Field.Error.

Examples

Label description and error

The Field wires its label, description and error to the control: leave the field to see the error appear and the input turn invalid.

Several errors and disabled

Several errors show as a list. disabled on the Field disables its control.

A form

Field.Set and Field.Legend group related fields. responsive puts labels in a column beside their controls when there is room; horizontal puts a label beside its control.

Billing

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

Field.Root

Prop Type Default Description
disabled boolean false Disable the control and dim the field.
invalid boolean false Mark the control invalid without an error message (a shown Field.Error does it too).
orientation "horizontal" | "vertical" | "responsive" 'vertical' Where the label goes: above the control (vertical), beside it (horizontal), or beside it when the field group is wide enough (responsive).

Field.Set

No props of its own beyond the common ones.

Field.Legend

Prop Type Default Description
variant "legend" | "label" 'legend' legend for a section heading, label for a legend that names a group of choices like a label.

Field.Group

No props of its own beyond the common ones.

Field.Content

No props of its own beyond the common ones.

Field.Label

No props of its own beyond the common ones.

Field.Title

No props of its own beyond the common ones.

Field.Description

No props of its own beyond the common ones.

Field.Error

Prop Type Default Description
errors FieldErrorItem[] – Validation errors, as form libraries return them; their messages are listed.