# FormField

A label, hint and error linked to a single control without manual IDs.

- Family: Forms, imported from `mizu-ui` or `mizu-ui/forms`
- Docs: https://mizu.user64bit.world/components/form-field
- Source: https://github.com/0xuser64bit/mizu/blob/main/packages/mizu/src/forms/Fields.tsx

## Usage

```tsx
import { FormField } from "mizu-ui";

export function Example() {
  return (
    <FormField label="Project" hint="A name people can find">
      <input className="mizu-input" />
    </FormField>
  );
}
```

## Copy it with the shadcn CLI

```sh
npx shadcn@latest init 0xuser64bit/mizu/preset # once, where there is no components.json
npx shadcn@latest add 0xuser64bit/mizu/form-field
```

## Props

- `label`: `string`. Visible accessible label.
- `hint / error`: `ReactNode / string`. Description and validation feedback.
- `children`: `ReactElement`. One control that accepts id and ARIA attributes.

## Accessibility

The label, hint and error are linked by unique IDs. Errors are announced. Use one native control as the child.

## Motion

CSS transitions explain state changes. Reduced motion removes travel.
