# Switch

A tactile binary setting whose thumb tracks the state.

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

## Usage

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

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

## 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/switch
```

## Props

- `label`: `string`. Setting name.
- `...input`: `InputHTMLAttributes`. Native checked/defaultChecked, disabled, onChange and ref.

## Accessibility

A native checkbox with role=switch. Space toggles; visible focus follows the thumb.

## Motion

CSS transitions explain state changes. Reduced motion removes travel.
