# Toggle (Andromeda Legacy)

Toggle is a component of the free, MIT-licensed Andromeda Legacy design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Sharp rectangular track + sliding rectangular thumb. Same vocabulary as Checkbox, but feels like a hardware switch.

- Design system: [Andromeda Legacy](https://aicanvas.me/design-systems/andromeda.md)
- License: MIT
- Install slug: `andromeda-toggle`
- Page: https://aicanvas.me/design-systems/andromeda/toggle

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-toggle
```

Needs a free AI Canvas account; signed out, the command writes a placeholder (an `AccountRequired` notice) instead.

Every Andromeda Legacy component at once: `npx shadcn@latest add @aicanvas/andromeda`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda/components/Toggle.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { Toggle } from '@/components/aicanvas/andromeda/components/Toggle'
```

## Example

```tsx
import { Toggle } from '@/components/aicanvas/andromeda/components/Toggle'

<Toggle label="Automatic deploys" defaultChecked />
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `checked?` | `boolean` |  | Controlled checked state; supplying it puts the switch in controlled mode. |
| `defaultChecked?` | `boolean` | `false` | Initial checked state when uncontrolled. |
| `onCheckedChange?` | `(next: boolean) => void` |  | Handler called with the next checked state whenever the switch toggles. |
| `label?` | `string` |  | Optional text rendered beside the switch and linked to it via htmlFor. |
| `disabled?` | `boolean` | `false` | Disables interaction and dims the switch. |
| `className?` | `string` |  | Extra classes merged onto the visual track. |
| `style?` | `React.CSSProperties` |  | Inline styles merged onto the wrapper element. |
| `id?` | `string` |  | Id for the input; falls back to a generated id and links the label. |

## More Andromeda Legacy components

- [Table](https://aicanvas.me/design-systems/andromeda/table.md)
- [Tooltip](https://aicanvas.me/design-systems/andromeda/tooltip.md)
- [Trend Chart](https://aicanvas.me/design-systems/andromeda/trend-chart.md)
- [User Card](https://aicanvas.me/design-systems/andromeda/user-card.md)
- [User Menu](https://aicanvas.me/design-systems/andromeda/user-menu.md)
