0 of 4 digits
Index
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initCardIndex(el) on the mounted element instead.
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/card-indexAbout 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