Components
Field
Labeled control wrapper that pulls validation errors from React Hook Form context by name.
Field wraps a single form control with its label, optional hint, and error
message, and handles the accessibility wiring (id, aria-invalid,
aria-describedby) for you. Inside a Form, pass name and it reads the
matching validation error straight from React Hook Form context; you can also
pass an error string manually to override it. The child can be a regular
element (it gets cloned with the resolved ARIA props) or a render function that
receives those props.
Example
Preview
Field wires label, hint, invalid state, and describedby IDs.
Slug is already taken.
import { Field, Input } from '@officina/ui';
<Field name="email" label="Email" hint="We never share it." required>
<Input type="email" />
</Field>;API
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | string | — | Visible field label. |
| error | string | — | Manual error message; overrides any RHF error for `name`. |
| hint | string | — | Helper text shown below the control. |
| name | string | — | RHF field name — used to read validation errors from form context. |
| required | boolean | — | Marks the field required (adds the required indicator). |