> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Collapse Component

## Article: Collapse Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/mechanisms/collapse-component.md

## Article Content:

# Collapse

_Components/Mechanisms_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/collapse>

## Overview

```jsx
() => {
  const [open, setOpen] = React.useState(true);

  return (
    <>
      <div
        style={{ display: 'flex', marginBottom: '15px', alignItems: 'center' }}
      >
        <ToggleSwitch
          checked={open}
          onChange={() => setOpen(!open)}
          size={'small'}
        />
        <span style={{ marginLeft: '10px' }}>Toggle collapse</span>
      </div>
      <Collapse open={open}>
        <FormField label="Some collapsible content">
          <Input />
        </FormField>
      </Collapse>
    </>
  );
};
```

Collapse makes content collapsible. Wrap content in `<Collapse/>` to show and hide it with an animation, or use it to build accordions.

### Do

- Use it to show and hide content that users open on demand, such as advanced settings.
- Connect it to a visible control, such as a button or toggle, that opens and closes it.

### Don't

- Don't build a list of collapsible sections from scratch. Use `<Accordion/>` instead.
- Don't hide content that users must read to complete a task.

## Code

```jsx
import { Collapse } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Content to render inside the collapse. |
| `dataHook` | `string` | — | Adds a `data-hook` attribute for testing purposes. |
| `mountOnEnter` | `boolean` | `true` | Delays mounting the component until it is displayed. If `false`, the component mounts immediately. If `true`, it mounts on first display. |
| `onCollapseAnimationEnd` | `(animationTiming?: AnimationTiming \| undefined) => void` | — | Triggered when the collapse animation completes. |
| `onExpandAnimationEnd` | `(animationTiming?: AnimationTiming \| undefined) => void` | — | Triggered when the expand animation completes. |
| `open` | `boolean` | `true` | Determines whether the collapse is open. |
| `position` | `"static" \| "sticky"` | `static` | Determines if the collapse stays fixed at the top of its container. |
| `unmountOnExit` | `boolean` | `true` | Unmounts the component after it finishes exiting. If `false`, the component stays mounted after exit. |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { CollapseUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { CollapseTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { CollapseTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { CollapseTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `isOpen` | Checks whether the component is expanded and the content is visible |
| `exists` | Checks whether the component found with the given data hook. |
| `element` | Gets the component root element. |
| `click` | Clicks on the component root element. |
| `base` | Returns UniDriver for the base element. |

## Changelog

- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.320.0** (2026-09-03) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.267.0** (2026-04-09) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.254.0** (2026-02-03) — maintenance release, no component-specific changes
- **1.144.0** (2024-12-03) — feat: position ([#14342](invalid-url))
- **1.116.0** (2024-07-22) — maintenance release, no component-specific changes
- **1.93.0** (2024-02-08) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes