# Glass Toggle

Glass Toggle is a free, MIT-licensed standalone component from AI Canvas (https://aicanvas.me): it belongs to no design system and works in any React + Tailwind app. Index of every component and install setup: https://aicanvas.me/llms.txt

On/off toggles with glass housing and liquid-feel spring animation. Track color transitions smoothly.

- Category: Buttons & Toggles
- Built with: Motion, Tailwind CSS
- License: MIT
- Page: https://aicanvas.me/components/glass-toggle

## Install

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

Needs a free AI Canvas account. Signed out, the command exits 0 but writes a placeholder (an `AccountRequired` notice); check for it before reporting success. Token setup: the Install section of https://aicanvas.me/llms.txt.

AI agents can also get its install command from the read-only AI Canvas MCP server (`npx -y @aicanvas/mcp`) and run it. Setup: https://aicanvas.me/mcp

Peer dependencies:

```bash
npm install framer-motion
```

## Use it

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

```tsx
import GlassToggle from '@/components/aicanvas/glass-toggle'

<GlassToggle />
```

It takes no props.

## About

Glass Toggle is an on/off switch housed in a frosted glass track, with a thumb that glides on a soft Motion spring while the track color transitions smoothly between states. The glass surface picks up the page behind it through backdrop-filter, so it always feels consistent with whatever you put under it. Drop it into glassmorphism dashboards, settings panels, theme switchers, or any UI that already leans on the same visual language for cards and modals.

Use cases: Settings, Dashboard, Theme switcher.

## Source

Install with the command above to get the source.

## Remix prompt

Only when the user wants Glass Toggle rebuilt from scratch instead of installed: its remix prompt is in the Remix panel at https://aicanvas.me/components/glass-toggle.

## Related

- [Glass Progress](https://aicanvas.me/components/glass-progress.md): Glassmorphism progress bar panel with glowing gradient fills, spring-animated counters, staggered reveal, and replay button.
- [Pill Toggle](https://aicanvas.me/components/pill-toggle.md): A minimal iOS-style slider toggle: thumb glides between off (grey) and on (green) with a snappy spring. Fully responsive.
- [Blind Pull Toggle](https://aicanvas.me/components/blind-pull-toggle.md): A dark/light mode toggle styled as a window-blind pull cord. Click to yank the cord and watch the icon swap through a venetian-blind slat animation.
- [Glass Tab Bar](https://aicanvas.me/components/glass-tab-bar.md): Frosted glass pill tab bar with a sliding active indicator. Edge tabs snap flush to the container wall.
- [Glass Modal](https://aicanvas.me/components/glass-modal.md): Centered dialog with deep glass blur, scale-spring entrance, and staggered content reveal.
