Pill ToggleA minimal iOS-style slider toggle — thumb glides between off (grey) and on (green) with a snappy spring.

Buttons & TogglesSettingsFormsDashboard

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/pill-toggle
2

For dark mode, add the dark class to your <html> element:

Optional
<html class="dark">

Install with AI Canvas MCP

With AI Canvas MCP, your AI knows every component we ship. Ask for “a navigation component from AI Canvas” inside Claude Code, Codex, or Cursor and it can suggest you a few options, then install the one you like. Less typing, lower token cost, modern way to build.

Get MCP

About Pill Toggle

Pill Toggle is the canonical iOS-style switch: a rounded track and a sliding thumb that snaps between grey (off) and green (on). The thumb travel is driven by Motion with a snappy spring, so the interaction feels immediate without overshooting. The whole component is keyboard and screen-reader friendly and adapts cleanly to dark mode through Tailwind tokens. Reach for it any time you would have used a checkbox for a binary on/off preference: settings panels, forms, dashboard rows, and inline feature flags.

Built with

MotionTailwind CSS

More like this