Field
Layout wrapper that groups a label, control, description, and error message.
Usage
import {Field} from 'kinu';
<Field>
<Field.Label>
Email
<Input type="email" required />
</Field.Label>
<Field.Description>We'll never share it</Field.Description>
<Field.Error>Please enter a valid email</Field.Error>
</Field>
Exports
| Name | Description | Rendered HTML |
|---|---|---|
| Field | Form field group | — |
| Field.Description | Supporting helper text | <div k="field-description"> |
| Field.Error | Validation error message | <div k="field-error"> |
Notes
- Nests the control inside
Field.Labelso native<label>implicit association handles pairing — noid/htmlForplumbing needed. Field.Labelis an alias ofLabel, so the regular label styles and props apply.:has(:invalid)turns the label destructive when any descendant control fails validation.Field.Errorrenders withrole="alert"so assistive tech announces it when shown.
_Source: src/components/field/index.tsx