Slosh
Markup where the component goes, CSS in your stylesheet. No JavaScript.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/radio-sloshAbout this component
A billing period switch, Monthly or Yearly, whose thumb is a glass capsule of blue water rolling with a slow wave. Pick the other side and the capsule glides over while the water sloshes back, over-runs and settles.
Triggers
- Click
- State change
- Ambient
- Loop
- Spring
Techniques
- Keyframes
- SVG
- CSS transition
- Transform only
- Gradient
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
Native radios in a fieldset with a visually hidden legend ("Billing period"), each in a <label> with its visible name (Monthly, Yearly); the capsule is aria-hidden. :focus-visible outlines the label.
Reduced motion
The waves, bubbles and slosh are switched off and the thumb moves at once.
Use it in anything you build, commercial and client work included. Licence