Expandable card
A card that grows in place to reveal its details.
When to use
- Summaries with optional detail, like a booking or an order.
- Several cards in a list where only one is read at a time.
When not to use
- The details are long; open a page or a drawer.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/expandable-card
Adds its 2 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
ExpandableCard
7 props
PropTypeDefaultDescription
title *string—
description *string—
mediaReactNode—A small square image or icon before the title.
actionsReactNode—Buttons shown under the details while open.
defaultOpenbooleanfalse
children *ReactNode—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-expanded, aria-controls and aria-hidden 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/expandable-card.mdThe index of every part is at /llms.txt.