Expand card
An App Store-style expand where a grid tile morphs into a centred detail panel.
API reference
Components
<ExpandCards />
Provider for a set of expanding cards. Renders no DOM.
children?
Grid of ExpandCardTriggers and one ExpandCardPanel.
scrimOpacity?
Scrim opacity (0-1). Default 0.72.
<ExpandCardTrigger />
Grid tile that expands on activation.
id
Card id matched against openId.
children?
Visible card content.
className?
Merged onto the morphing surface.
"aria-label"?
Button accessible name.
<ExpandCardShared />
Sub-element that morphs with its card's surface.
part
Stable part name (e.g. "icon", "head").
as?
Element to render. Default "span".
layout?
Pass "position" to morph position only, not size.
className?
Merged onto the element.
children?
Part content.
<ExpandCardPanel />
Expanded detail dialog. One per ExpandCards group.
children
Dialog body, or a render function receiving the open card's id.
className?
Merged onto the dialog surface.
contentClassName?
Merged onto the inner content wrapper.
labelledBy?
Builds aria-labelledby from the open card's id.
describedBy?
Builds aria-describedby from the open card's id.
initialFocusRef?
Where focus lands on open.
<ExpandCardBody />
Non-shared body that cross-fades in after the surface morph settles.
children?
Non-shared dialog detail content.
className?
Merged onto the wrapper.
Hooks
useExpandCard
Read expand/collapse controls from inside an ExpandCards group.
useExpandCard(): UseExpandCardReturns
openId
Id of the expanded card, or null.
open
Expand the card with this id.
close
Collapse the open card.
isOpen
Whether the card with this id is expanded.
Featured in
See the expand card composed into full sections.
