Bridge

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-bridge

About this component

Three matte black slabs, Design, Code and Ship, coupled on one rail with a pin light each; two stand open at a time and the third sits folded to a thin bar that shows only its pin. Press any slab: a folded one opens while the older open one folds away, and an open one folds while the folded one opens, so exactly two are always open. The red spark rides the coupling between the open pair; the slab opened last carries a white pin, the other open one green, the folded one red.

Triggers

  • Card
  • Click
  • State change
  • Spring
  • Glow

Techniques

  • CSS variables
  • CSS transition
  • clip-path
  • Gradient
  • Pseudo elements
  • SVG filter
  • Keyframes

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

A section labelled Design, code and ship. Each slab is a native button named by its title with aria-expanded true when open and false when folded; the spark is a button labelled Open <name>. Arrow keys move focus between the slabs and Enter or Space toggles the focused one; focus rings are 2px, offset 2px.

Reduced motion

The slabs jump to their new places and the star does not pulse.

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

More cards

See all
CabinGet code
CellGet code

Holding

ClimateGet code

48km/h

74%

ClusterGet code