Checkbox & toggles
Spring Switch
A switch whose knob does not travel but overshoots slightly and stretches along the way. Not a line of JS: it all rests on :checked.
React + Tailwind, shadcn-compatible: press “Copy for AI” and your Cursor or Claude Code agent installs it with the shadcn CLI.
What you can change
- the label and description copy; without description the row becomes single-line
- any native input props: name, checked, defaultChecked, onChange, value
- disabled — it dims both the row and the switch
A link for your AI agent: preview, code and instructions.
Preview

Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.club/c/switch-016?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
How to use
<Switch016
name="sync"
defaultChecked
label="Instant sync"
/>A sample call. The agent installs the component itself from the registry via the “Copy for AI” link.
Settings
- Label
label· default: Instant sync- Description
description· default: Changes go to the cloud right away, with no Save button.- On
defaultChecked· default: on- Disabled
disabled· default: off- Accent
accent· default: theme colour- Background
background· default: theme colour
More in Checkbox & toggles
FAQ
- How do I add Spring Switch with Cursor or Claude Code?
- Press “Copy for AI” on this page and paste it into your agent's chat. The instruction contains the shadcn CLI install command, the dependencies and what to keep, so the agent installs this exact component instead of recreating a lookalike.
- What does Spring Switch depend on?
- No npm packages beyond React and Tailwind CSS.
- What can I change in Spring Switch?
- Adapt: the label and description copy; without description the row becomes single-line; any native input props: name, checked, defaultChecked, onChange, value; disabled — it dims both the row and the switch. Keep as installed: the local --vibeui-switch-016-* palette — do not swap it for your theme tokens; the different transition delays on left and right: they are what stretches the knob, not keyframes; the overshooting linear() spring curve — without it the switch merely travels.
- Is Spring Switch free?
- Yes. The preview is open without an account; with a free account you can copy up to 20 components a month.
For developers
npx shadcn@latest add https://vibeui.club/r/pro/switch-016.jsonThis command needs a signed link: sign in and open “Component source” below — it issues a working link valid for 30 minutes. All install options
Technical notes
The component is self-contained: one file, no dependencies, its own palette in the local --vibeui-switch-016-* variables. Server-side: the state is carried by a native input[type=checkbox] with role="switch" and appearance:none — the input itself is the track and the neighbouring span is the knob. The stretch is done without keyframes: the knob is pinned to both edges of the track at once and left and right have different transition delays, so the leading edge starts first and the trailing edge catches up 70 ms later — the knob stretches equally honestly in both directions. The overshoot comes from a linear() spring curve. The root is a <label>, so the whole row is the click target. The theme comes from light-dark() plus the :where(.dark,[data-theme="dark"]) … {color-scheme:dark} rule.
Tags
- switch
- toggle
- spring
- css-only
- settings
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…