Slosh

Billing period
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-slosh

About 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

More radios

See all
Section
TeletextGet code
Package manager
ASCIIGet code
Balloon
BalloonsGet code
Output
BauhausGet code