Expandable Data Card
Use Expandable Data Card to keep a key metric visible while revealing its breakdown in the same surface. The card grows inline, so the detail stays connected to the summary without an overlay.
Preview
Total revenue
$39,820
Sep 1 to Sep 30
Installation
Basic usage
Usage
API
| Property | Type | Default | Description |
|---|---|---|---|
title | string | required | Short label describing the data shown in the card. |
summary | ReactNode | required | Always-visible summary content, such as a metric and its change. |
children | ReactNode | required | Additional data revealed when the card expands. |
open | boolean | undefined | Controlled expanded state. |
defaultOpen | boolean | false | Initial expanded state when uncontrolled. |
onOpenChange | (open: boolean) => void | undefined | Called when the user opens or closes the card. |
className | string | undefined | Additional classes for the card surface. |
Accessibility
The Details button exposes its expanded state and maintains a stable connection to the detail container. The card title labels the revealed region. Exiting content becomes inert immediately, and focus returns to the Details button if a controlled close would remove the focused element. Reduced-motion users receive the same content without the morphing transition.
Detail content unmounts after closing. Keep any form values or other state that must survive reopening in the parent component.
Styling
CLI installation registers the shadow utilities automatically. For manual installation, install shadow-plugin and add @plugin "shadow-plugin"; to your Tailwind v4 stylesheet.
The component owns the expandable surface and interaction. Supply your own metric summary and detail content, and use className to adapt the card width or surface color.
Was this page helpful?
Your response helps us improve component docs.