Forms
Field
A label, a control, a hint and an error, in one layout with the right spacing, across or stacked.
Forms
A label, a control, a hint and an error, in one layout with the right spacing, across or stacked.
Change the props on the right. The field and its code follow.
Shown in the sidebar and in the CLI.
import { Field, FieldDescription, FieldGroup, FieldLabel } from 'omuk-ui/field';
import { Input } from 'omuk-ui/input';
<FieldGroup>
<Field>
<FieldLabel htmlFor="name">Project name</FieldLabel>
<Input id="name" placeholder="Billing service" aria-describedby="name-hint" />
<FieldDescription id="name-hint">Shown in the sidebar and in the CLI.</FieldDescription>
</Field>
</FieldGroup>Field stacks its parts with the form’s spacing: the label above, the hint below. FieldGroup spaces the fields of a form.
Shown in the sidebar and in the CLI.
FieldError takes the messages of a check and shows one as a line, more as a list. It draws nothing while there are none. Set aria-invalid on the control as well, so its edge turns red. Type a name with no space.
FieldSet and FieldLegend name a group of checkboxes or radios. A horizontal Field puts the control and its label on one line; data-disabled on the Field mutes its label.
A FieldLabel around a whole Field is a card: the whole card picks the choice, and the picked card takes the accent edge.
Every part also takes the props of its element: a <div>, or a <fieldset>, <legend>, <label> or <p>.