Switch
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.
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.ru/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…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
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…