Skip to content
caliper ui docs

Pro

Expandable card

A card that grows in place to reveal its details.

Pro
pnpm dlx shadcn@latest add @caliper/expandable-card

Check-in opens at 15:00. Late arrivals use the side door on Quay Street and the code 4721 from the booking. Breakfast runs 7:30 to 10:30 in the terrace room.

The track is gravel for the last 2 km; the key box is left of the door, code 1180. Firewood is in the shed and the hot tub is ready from 16:00.
Installs components/ui/expandable-card.tsxDepends on lucide-reactMotion none in component source

When to use

Use it for

  • Summaries with optional detail, like a booking or an order.
  • Several cards in a list where only one is read at a time.

Skip it when

  • 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { ExpandableCard } from "@/components/ui/expandable-card"

The worked example comes with Pro

The 15-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
Checking your licence…

API reference

ExpandableCard

component
PropTypeDefault
title *string—
description *string—
children *ReactNode—
classNamestring—

Accessibility

It is built on native elements and keeps aria-expanded, aria-controls and aria-hidden in step with state.

No custom key handling; Tab and the native activation keys do the work.

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.

All Sheet examples