Card morph
A card that morphs into a detail view.
Coastal studio
Projects Mara Chen shared with you this week
When to use
- Moving from a list item to its detail with context.
When not to use
- The detail is a separate page.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/card-morph
Adds its 3 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
CardMorph
5 props
PropTypeDefaultDescription
title *string—
preview *ReactNode—What the card shows while closed.
children *ReactNode—What the opened panel shows.
widthnumber640
classNamestring—
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
- Tab
- Moves focus through the part's focusable elements.
Accessibility
It exposes dialog semantics, with aria-haspopup, aria-expanded, aria-hidden, aria-modal, aria-labelledby and aria-label kept in step with state.
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-morph.mdThe index of every part is at /llms.txt.