Card switcher
An app switcher for open pages. Cards fan out in depth by recency: the page you are on is in front and each step back is one page older. Flick a card up to close it, press the front card to open it full size.
When to use
- Mobile-style multitasking: open documents, tabs or conversations.
- Reviewing a handful of recent items and dropping the ones you are done with.
When not to use
- Long lists; use a list with search.
- Anything that needs all items visible at once.
Installation
pnpm dlx shadcn@latest add @caliper/card-switcher
Adds its 7 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
CardSwitcher
14 props
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
- ←
- Moves to the previous item or value.
- →
- Moves to the next item or value.
- Delete
- Removes the next character or the selected item.
Accessibility
It exposes group and region semantics, with aria-label, aria-describedby, aria-hidden and aria-live kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/card-switcher.mdThe index of every part is at /llms.txt.