# Checkbox

A labeled native checkbox for independent choices.

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, Checkbox } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Checkbox label="Send project updates" name="updates" defaultChecked />
    </FloodRoot>
  );
}
```

## Design notes

- Use checked/onChange for controlled state or defaultChecked for native state.
- Labels stay visible. Disabled does not mean read-only; explain unavailable choices outside the disabled control when needed.
- The control and visible label form one content-width unit with an 8px-at-16px-root internal gap. Use an explicit parent gap="4" (16px at that root) between units; the glyph keeps its token-defined size.
- indeterminate sets the native mixed state after hydration; checked still controls form submission. The host owns select-all aggregation and updates. Radio and Switch do not expose this prop.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `ReactNode` | `Required` |
| `indeterminate` | `boolean` | `false` |
| `Native HTML props` | `Omit<InputHTMLAttributes<HTMLInputElement>, "type" \| "size">` | `Forwarded` |
