# Expandable Card

> Grows in place and pushes the rest down smoothly.

A disclosure card for FAQs, changelogs and settings groups, with nothing jumping around it.

- Family: Cards
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/expandable-card/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add expandable-card
```

It installs to `components/galactrex/expandable-card.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { ExpandableCard } from "@/components/galactrex/expandable-card";

<ExpandableCard summary={<h3>What is included?</h3>}>…</ExpandableCard>
```

## 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

- Layout animation for the card and siblings.
- Reduced motion: instant.
