# Collapsible

> A single section that shows and hides its content.

- Category: [Navigation](https://tarve.dev/docs.md#navigation)
- Import: `import { Collapsible } from "@tarve/core";`
- Props type: `CollapsibleProps`
- Source: [packages/core/src/extra-controls.ts:556](https://github.com/omarcosr/tarve/blob/main/packages/core/src/extra-controls.ts#L556)

## Usage

```tsx title="Collapsible.tsx"
import { Collapsible, Column, Icon, Row, Text } from "@tarve/core";

let open = true;

<Collapsible
  open={open}
  label="Advanced options"
  trigger={
    <Row gap={8} align="center" style={{ width: 280, justify: "between" }}>
      <Text weight={600}>Advanced options</Text>
      <Icon name={open ? "chevron-up" : "chevron-down"} size={16} />
    </Row>
  }
  onOpenChange={(next) => {
    open = next;
  }}
>
  <Column gap={4} style={{ padding: { top: 8 } }}>
    <Text size={13}>Hardware acceleration</Text>
    <Text size={13}>Experimental renderer</Text>
  </Column>
</Collapsible>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `open` (required) | `boolean` | — |  |
| `trigger` (required) | `Child` | — |  |
| `disabled` | `boolean` | — |  |
| `label` | `string` | `"Toggle section"` |  |
| `onOpenChange` | `(open: boolean) => void` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [Accordion](https://tarve.dev/docs/components/Accordion.md) · Next: [Breadcrumb](https://tarve.dev/docs/components/Breadcrumb.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Collapsible · Index for agents: https://tarve.dev/llms.txt
