Cell

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-cell

About this component

A standing battery filled with waving liquid that runs from red through amber to green as the level climbs. Press the plug under it and it snaps up into the battery's port and charges, a pulse running up its cable; press it again and it pulls out. Drag the battery to set a level.

Triggers

  • State change
  • Click
  • Continuous
  • Fill
  • Loop
  • Card
  • 3D

Techniques

  • CSS variables
  • Keyframes
  • Interval
  • Event position
  • clip-path
  • CSS transition
  • SVG
  • Gradient
  • Spring

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

The battery is a role='slider' with aria-valuenow and an aria-valuetext that says 'charging'; arrow keys step 5%, Home and End go to 0 and 100. The plug is a native button labelled 'Charge' that exposes aria-pressed, and its focus ring is drawn round the plug and moves with it.

Reduced motion

Reduced motion removes the waves, bubbles, spark, pulse and transitions; the plug still seats and the level still changes.

Use it in anything you build, commercial and client work included. Licence

More cards

See all

Holding

ClimateGet code
FlapGet code
ForecastGet code
HomeGet code