Index

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/card-index

About this component

A card-index drawer drawn in fine line, the tabbed cards receding into the drawer in perspective with filled letter tabs between them. Drag to riffle the cards forward or back, or press any card and the stack scrolls until it stands at the front, tipped open toward you with its number on its tab; press a letter tab and the drawer skips to that letter; arrow keys step.

Triggers

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

Techniques

  • CSS variables
  • CSS transition
  • SVG
  • Event position
  • State machine
  • Transform only

Difficulty

Advanced

Accessibility

Keyboard and screen readers

The card is a role='slider' labelled Card index with aria-valuenow as the front card's number and an aria-valuetext reading Card n of 60 at the front; arrow keys, PageUp, PageDown, Home and End move it and a 2px inset ring shows focus. The letter tabs are native buttons named by letter and count (only those in the front four rows are in the tab order). Plain cards are aria-hidden.

Reduced motion

The cards jump to their new rows without the slide.

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

More cards

See all

0 of 4 digits

KeypadGet code

22°

LouverGet code
MascotGet code

Dana Kole, 12 days

MistGet code