# Field

The association between a visible label, its input and supporting messages.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, Field, Input } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Field label="Project name" required hint="Visible to your team.">
        {(control) => <Input {...control} name="project" />}
      </Field>
    </FloodRoot>
  );
}
```

## Design notes

- Spread the supplied control props onto one Input or Textarea.
- Field merges describedBy with hint/error IDs and forwards native required through its function child.
- The host owns validation rules. Compose Field in a client component in Next.js.
- Field is not a generic native div wrapper and does not forward a ref.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
| `message` | `ReactNode` | `—` |
| `id` | `string` | `—` |
| `label` | `ReactNode` | `Required` |
| `hideLabel · 0.2.3` | `boolean` | `false` |
| `hint` | `ReactNode` | `—` |
| `error` | `ReactNode` | `—` |
| `required` | `boolean` | `—` |
| `describedBy` | `string` | `—` |
| `children` | `(props: FieldControlProps) => ReactNode` | `Required` |
