Appearance
FormField
Gắn id, label, hint, error → aria-invalid / aria-describedby.
ts
import { FormField } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { FormField, Input } from "@minap/ui";
export function Example() {
return (
<>
<FormField id="ff-ok" label="OK" hint="Hint tone">
<Input />
</FormField>
<FormField id="ff-err" label="Error" error="Error tone + aria-invalid">
<Input />
</FormField>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
id | string | — | Bắt buộc — id của control |
label | string | — | Bắt buộc |
hint | ReactNode | — | Thông báo hint tùy chọn |
error | ReactNode | — | Gán aria-invalid cho child |
children | single control element | — | Input/SelectTrigger/… |
Behavior
- Liên kết a11y form
- Hoạt động với Input, Textarea, SelectTrigger