# Switch

A labeled on/off setting with native checkbox form behavior.

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

export function Example() {
  return (
    <FloodRoot>
      <Switch label="Email notifications" name="notifications" defaultChecked />
    </FloodRoot>
  );
}
```

## Design notes

- Switch uses a native checkbox with role="switch".
- checked/defaultChecked, name/value, reset and disabled remain native. The component does not persist settings.
- 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.

## API reference

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