Cards
CreativeExpandable Card
A disclosure card for FAQs, changelogs and settings groups, with nothing jumping around it.
Install
Included with Creative: needs your API key. Initialize and log in once.
npx @galactrex/ui add expandable-cardUsage
import { ExpandableCard } from "@/components/galactrex/expandable-card";
<ExpandableCard summary={<h3>What is included?</h3>}>…</ExpandableCard>Source
Installs to components/galactrex/expandable-card.tsx, with the shared motion primitives beside it.
Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
summary | ReactNode | — | Always visible. |
children | ReactNode | — | Shown when expanded. |
defaultOpen | boolean | false | Initial state. |
labels | [string, string] | — | Toggle words. |
className | string | — | Extra classes for the outer element. |
Variants
- FAQ. A stack of them.
Accessibility
- A disclosure button with aria-expanded and aria-controls.
Motion and reduced motion
- Layout animation for the card and siblings.
- Reduced motion: instant.