Skip to content

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 / APITypeDefaultNotes
idstring—Bắt buộc — id của control
labelstring—Bắt buộc
hintReactNode—Thông báo hint tùy chọn
errorReactNode—Gán aria-invalid cho child
childrensingle control element—Input/SelectTrigger/…

Behavior ​

  • Liên kết a11y form
  • Hoạt động với Input, Textarea, SelectTrigger

MINAP UI — Soft Periwinkle light, Mobile-First