> A component of a Premium AI Canvas design system. Index of every system, component and install setup: https://aicanvas.me/llms.txt

# Collapsible (Andromeda Pro)

Opens and closes the section under a one-line row, for detail the reader may want.

- Design system: [Andromeda Pro](https://aicanvas.me/design-systems/andromeda-pro.md)
- License: Premium (proprietary)
- Install slug: `andromeda-pro-collapsible`
- Page: https://aicanvas.me/design-systems/andromeda-pro/collapsible

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-pro-collapsible
```

Requires Premium. Without a Premium token the command writes a placeholder instead of the component.

Every Andromeda Pro component at once: `npx shadcn@latest add @aicanvas/andromeda-pro`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Props

### Collapsible

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open?` | `boolean` |  | Controlled open state. Pair with onOpenChange. |
| `defaultOpen?` | `boolean` | `false` | Initial open state when uncontrolled. |
| `onOpenChange?` | `(open: boolean) => void` |  | Called with the next open state when the trigger is pressed. |
| `disabled?` | `boolean` | `false` | The row cannot be toggled: dimmed to the disabled opacity, not-allowed cursor, no hover, no aria-expanded. The section keeps whatever state `open` gives it. |
| `children?` | `React.ReactNode` |  | A CollapsibleTrigger followed by a CollapsibleContent. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

### CollapsibleTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `React.ReactNode` |  | The row's label, set medium weight. |
| `indicator?` | `React.ReactNode\|false` |  | Replaces the caret, e.g. a Spinner while the section has nothing in it yet. Drawn in a glyph-sized slot, aria-hidden. `false` removes the slot: the label starts at the row's edge and the section's inset follows it. |
| `meta?` | `React.ReactNode` |  | Trailing text pushed to the right edge in text.secondary: a duration, a count, a state word. |
| `size?` | `'sm'\|'md'` | `'sm'` | Row rung: 12 / 14px label, 16 / 18px caret, 8px gap. |
| `onClick?` | `(event: React.MouseEvent<HTMLButtonElement>) => void` |  | Runs before the toggle; call preventDefault to keep the row as it is. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

### CollapsibleContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children?` | `React.ReactNode` |  | The section. Children stack in a column 12px apart. |
| `guide?` | `boolean` | `false` | Hang the section off a hairline rule under the caret (the step-trace look). Off, the section starts where the label starts. |
| `className?` | `string` |  | Merged onto the section's box (the element that carries the padding and gap). |
| `style?` | `React.CSSProperties` |  | Merged onto the section's box. |

## Remix prompt

The public part of this component's remix prompt. The rest of the build spec is part of Premium.

```markdown
Build **Collapsible**: a row that opens and closes the section below it. The row is the disclosure: a bare text button, a caret that turns a quarter when the section is open, and an optional trailing meta pushed to the right. React + TypeScript, one file, named exports `Collapsible`, `CollapsibleTrigger`, `CollapsibleContent` and their props types (`CollapsibleProps`, `CollapsibleTriggerProps`, `CollapsibleContentProps`). Use framer-motion for the height and the caret, and the AI Canvas `chevron-right` icon (`@/components/icons/chevron-right`).

It is drawn to sit on a near-black ground, `oklch(0.135 0.002 286.2)`. The component never paints that ground itself; it inherits whatever surface it is dropped on. Typeface: Manrope, falling back to the system sans.
```

## More Andromeda Pro components

- [Combobox](https://aicanvas.me/design-systems/andromeda-pro/combobox.md)
- [Corner Markers](https://aicanvas.me/design-systems/andromeda-pro/corner-markers.md)
- [Date Range Picker](https://aicanvas.me/design-systems/andromeda-pro/date-range-picker.md)
- [Drawer](https://aicanvas.me/design-systems/andromeda-pro/drawer.md)
- [Empty State](https://aicanvas.me/design-systems/andromeda-pro/empty-state.md)
