Pro
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.
pnpm dlx shadcn@latest add @caliper/card-switcherWhen to use
Use it for
- Mobile-style multitasking: open documents, tabs or conversations.
- Reviewing a handful of recent items and dropping the ones you are done with.
Skip it when
- Long lists; use a list with search.
- Anything that needs all items visible at once.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Every gesture has a key and a button
- Arrow keys move, Enter opens, Delete closes, Escape returns. Previous, Next and Open are plain buttons and a count reads, for example, 4 open · 2 of 4.
- Closing is yours to confirm
- The card flicks away, then onClose tells you which page it was. You remove it from pages, and the rest close the gap.
Usage
- Empty can offer a way back
- Pass onReopen and the empty switcher shows Reopen all.
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.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { CardSwitcher } from "@/components/ui/card-switcher"
The worked example comes with Pro
The 43-line example behind the preview opens here, ready to copy.
- 626 Pro parts, blocks and page templates, all with source
- $149 once, with lifetime updates. No renewal
- A full refund within 14 days if it is not for you
API reference
CardSwitcher
component
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.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.