> 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: Accordion Component

## Article: Accordion Component

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

## Article Content:

# Accordion

_Components/Lists_

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

## Overview

```jsx
<Accordion
  skin="light"
  hideShadow={true}
  items={[
    accordionItemBuilder({
      title: 'How can I start a blog for free?',
      children: (
        <Box width="50%">
          <Text text="small" secondary>
            First of all you'll need to choose a blogging platform with free
            user options. With Wix, for example, you can create a blog for free.
            You can also save money when starting a blog by writing all of your
            content yourself, and by using as many free content planning and
            keyword research tools as possible.
          </Text>
        </Box>
      ),
    }),
    accordionItemBuilder({
      title: 'How do I make a successful blog?',
      children: (
        <Box width="50%">
          <Text text="small" secondary>
            First of all you'll need to define 'successful.' Generally a
            successful blog is one which has a large readership, and generates
            considerable amounts of traffic. But depending on your blog niche,
            the goals of a successful blog may look different.
          </Text>
        </Box>
      ),
    }),
  ]}
/>;
```

Accordion is a list of items that shows and hides content in collapsible sections.

### Do

- Use it to organize content by grouping it into collapsible sections.
- Use it to show information on user demand only.

### Don't

- Don't use when content is crucial to read in full. Use `<Card/>` with section titles instead.

### Feature examples

#### Vertical padding

Control vertical padding of accordion items with `size` prop:

- `large` is a larger size that emphasizes a few items.
- `medium` (default) is a standard size for common cases.
- `small` and `tiny` are compact sizes that display more items in a smaller space.

Note that `size` prop only controls the padding of accordion items (and not their inner content).

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    size="large"
    items={[
      accordionItemBuilder({
        title: 'Large',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Large',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    size="medium"
    items={[
      accordionItemBuilder({
        title: 'Medium',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Medium',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    size="small"
    items={[
      accordionItemBuilder({
        title: 'Small',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Small',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    size="tiny"
    items={[
      accordionItemBuilder({
        title: 'Tiny',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Tiny',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Horizontal padding

Control horizontal padding of accordion items and their inner content with `horizontalPadding` prop:

- `large` (default) is a standard size for common cases.
- `medium` is a more compact size.
- `small` and `tiny` are the most compact sizes used to display more content in narrow spaces.
- `none` has no horizontal padding.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    horizontalPadding="large"
    items={[
      accordionItemBuilder({
        title: 'Large',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Large',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    horizontalPadding="medium"
    items={[
      accordionItemBuilder({
        title: 'Medium',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Medium',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    horizontalPadding="small"
    items={[
      accordionItemBuilder({
        title: 'Small',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Small',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    horizontalPadding="tiny"
    items={[
      accordionItemBuilder({
        title: 'Tiny',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Tiny',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    horizontalPadding="none"
    items={[
      accordionItemBuilder({
        title: 'None',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'None',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Skin

Control the appearance of the accordion with `skin` prop:

- `standard` (default) is used to visually separate accordion items from their inner content.
- `light` is used when both items and their inner content need to be white.
- `neutral` is used to emphasize accordion items over their inner content.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    skin="standard"
    items={[
      accordionItemBuilder({
        title: 'Standard',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Standard',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    skin="light"
    items={[
      accordionItemBuilder({
        title: 'Light',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Light',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    skin="neutral"
    items={[
      accordionItemBuilder({
        title: 'Neutral',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Neutral',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Shadow

Hide the inner content shadow with `hideShadow` prop.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    hideShadow={false}
    skin="light"
    items={[
      accordionItemBuilder({
        title: 'With shadow',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'With shadow',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    hideShadow={true}
    skin="light"
    items={[
      accordionItemBuilder({
        title: 'No shadow',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'No shadow',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Title and subtitle

Describe accordion items using `title` and `subtitle` props.

These containers also accept any component or a composition of multiple elements.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'Title',
        subtitle: 'Subtitle',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Title',
        subtitle: (
          <Box gap="SP1">
            <Text size="small">Subtitle</Text>
            <TextButton size="small" underline="always">
              Learn More
            </TextButton>
          </Box>
        ),
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: <StorybookComponents.Placeholder height="18px" />,
        subtitle: <StorybookComponents.Placeholder height="18px" />,
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Title size

You can control the size of the title text:

`titleSize` sets the header text size: `small` or `medium` (default).

```jsx
() => (
  <Box gap="20px" direction="vertical">
    <Accordion
      items={[
        {
          title: 'Medium title size (default)',
          initiallyOpen: true,
          children: <Text size="small">Accordion content</Text>,
        },
        {
          title: 'Medium title size',
          children: <Text size="small">More accordion content</Text>,
        },
      ]}
    />

    <Accordion
      titleSize="small"
      items={[
        {
          title: 'Small title size',
          initiallyOpen: true,
          children: <Text size="small">Accordion content</Text>,
        },
        {
          title: 'Small title size',
          children: <Text size="small">More accordion content</Text>,
        },
      ]}
    />
  </Box>
);
```

#### Prefix icon

Add a prefix icon in front of an accordion item with `icon` prop.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'With icon',
        icon: <Icons.Location />,
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'With icon',
        icon: <Icons.Location />,
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Sections

Organize accordion items into groups using `accordionSectionItemBuilder`.

```jsx
<Accordion
  size="small"
  items={[
    accordionSectionItemBuilder({
      title: 'Section A',
    }),
    accordionItemBuilder({
      title: 'First item',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
    accordionItemBuilder({
      title: 'Second item',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
    accordionSectionItemBuilder({
      title: 'Section B',
    }),
    accordionItemBuilder({
      title: 'Third item',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
    accordionItemBuilder({
      title: 'Fourth item',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
  ]}
/>;
```

#### Show/hide button

Define the show/hide action at the end of accordion item with `buttonType` prop. It can be:

- Default chevron icon.
- `textButton`.
- `button`.
- or a custom control (`node`).

Provide the labels for these actions, such as 'Show' and 'Hide' with `expandLabel` and `collapseLabel` props.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'Default',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Default',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'Text button',
        showLabel: 'always',
        buttonType: 'textButton',
        expandLabel: 'Show',
        collapseLabel: 'Hide',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Text button',
        showLabel: 'always',
        buttonType: 'textButton',
        expandLabel: 'Show',
        collapseLabel: 'Hide',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'Button',
        buttonType: 'button',
        expandLabel: 'Show',
        collapseLabel: 'Hide',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Button',
        buttonType: 'button',
        expandLabel: 'Show',
        collapseLabel: 'Hide',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'Custom control',
        buttonType: 'node',
        showLabel: 'always',
        expandLabel: (
          <IconButton skin="standard" priority="secondary" size="small">
            <Icons.ChevronDown />
          </IconButton>
        ),
        collapseLabel: (
          <IconButton skin="standard" priority="secondary" size="small">
            <Icons.X />
          </IconButton>
        ),
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Custom control',
        buttonType: 'node',
        showLabel: 'always',
        expandLabel: (
          <IconButton skin="standard" priority="secondary" size="small">
            <Icons.ChevronDown />
          </IconButton>
        ),
        collapseLabel: (
          <IconButton skin="standard" priority="secondary" size="small">
            <Icons.X />
          </IconButton>
        ),
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Initially open

By default, all accordion items are closed until expanded by the user.

Open one or multiple accordion items from the start with `initiallyOpen` prop.

```jsx
() => (
  <Accordion
    items={[
      {
        title: 'Default',
        children: (
          <Box padding="20px" align="center" verticalAlign="middle">
            <Text size="small">Item content</Text>
          </Box>
        ),
      },
      {
        title: 'Initially open',
        initiallyOpen: true,
        children: (
          <Box padding="20px" align="center" verticalAlign="middle">
            <Text size="small">Item content</Text>
          </Box>
        ),
      },
    ]}
  />
);
```

#### Open multiple items

By default, only one accordion item can be open at a time.

Allow opening multiple items at once with `multiple` prop.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Accordion
    items={[
      accordionItemBuilder({
        title: 'Default',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Default',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
  <Accordion
    multiple
    items={[
      accordionItemBuilder({
        title: 'Multiple items open',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
      accordionItemBuilder({
        title: 'Multiple items open',
        children: (
          <StorybookComponents.Placeholder>
            <Box verticalAlign="middle" align="center">
              <Text size="small">Item content</Text>
            </Box>
          </StorybookComponents.Placeholder>
        ),
      }),
    ]}
  />
</StorybookComponents.Stack>;
```

#### Disabled item

Disable an accordion item with `disabled` prop.

Users will not be able to expand or collapse it.

```jsx
<Accordion
  items={[
    accordionItemBuilder({
      title: 'Default',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
    accordionItemBuilder({
      title: 'Disabled',
      disabled: true,
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
    accordionItemBuilder({
      title: 'Disabled open',
      disabled: true,
      initiallyOpen: true,
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
  ]}
/>;
```

#### Content padding

`contentPadding` controls the inner spacing around an accordion item's expanded content.

- Default: content keeps the built-in inner padding.
- `contentPadding="none"`: removes that inner padding so content starts at the container edge.

```jsx
() => (
  <Box gap="20px" direction="vertical">
    <Accordion
      items={[
        {
          title: 'Default content padding',
          initiallyOpen: true,
          children: (
            <Box border="1px dashed" padding="12px">
              <Text size="small">
                This content sits inside the default accordion padding.
              </Text>
            </Box>
          ),
        },
      ]}
    />

    <Accordion
      contentPadding="none"
      items={[
        {
          title: 'No content padding',
          initiallyOpen: true,
          children: (
            <Box border="1px dashed" padding="12px">
              <Text size="small">
                This content starts right at the accordion content edge.
              </Text>
            </Box>
          ),
        },
      ]}
    />
  </Box>
);
```

### Developer examples

#### Using item builders

Accordion is composed from a list of items that share expand/collapse feature. To create them in the most efficient way, use `accordionItemBuilder`.

Note: presenting accordion items as plain objects is still available as a legacy pattern, but it shouldn't be used in any new projects.

```jsx
<Accordion
  items={[
    accordionItemBuilder({
      title: 'First item',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
    accordionItemBuilder({
      title: 'Second item',
      children: (
        <StorybookComponents.Placeholder>
          <Box verticalAlign="middle" align="center">
            <Text size="small">Item content</Text>
          </Box>
        </StorybookComponents.Placeholder>
      ),
    }),
  ]}
/>;
```

#### Controlled

Component can be used in controlled mode by passing `open` and `onToggle` props to accordionItemBuilder.

```jsx
() => {
  const [isOpen, setIsOpen] = React.useState(false);
  return (
    <Accordion
      items={[
        accordionItemBuilder({
          title: 'First item',
          onToggle: () => setIsOpen(!isOpen),
          open: isOpen,
          children: (
            <StorybookComponents.Placeholder>
              <Box verticalAlign="middle" align="center">
                <Text size="small">Item content</Text>
              </Box>
            </StorybookComponents.Placeholder>
          ),
        }),
      ]}
    />
  );
};
```

### Common use case examples

#### In a side panel

Accordion in a side panel allows for efficient use of space.

Allow to open only one accordion item at a time. This will minimise the cognitive load and scrolling required by the user.

```jsx
() => {
  const checkboxes = [
    {
      id: '1',
      label: '2023 Winter',
      isChecked: true,
    },
    {
      id: '2',
      label: '2023 Spring',
      isChecked: true,
    },
    {
      id: '3',
      label: '2022 Winter',
      isChecked: false,
    },
    {
      id: '4',
      label: '2022 Spring',
      isChecked: false,
    },
  ];

  const [checkboxesList, setCheckboxesList] = React.useState(checkboxes);

  const isAllSelected = checkboxesList.every((item) => item.isChecked);
  const isAllDeselected = checkboxesList.every((item) => !item.isChecked);

  const toggleCheckedAll = (checked) => {
    const updatedCheckboxes = checkboxesList.map((item) => ({
      ...item,
      isChecked: checked,
    }));
    setCheckboxesList(updatedCheckboxes);
  };

  const toggleCheckbox = (id) => {
    const updatedCheckboxes = checkboxesList.map((item) =>
      item.id === id ? { ...item, isChecked: !item.isChecked } : item,
    );
    setCheckboxesList(updatedCheckboxes);
  };

  const renderCheckboxes = () =>
    checkboxesList.map((item) => (
      <Checkbox
        key={item.id}
        id={item.id}
        checked={item.isChecked}
        onChange={() => toggleCheckbox(item.id)}
      >
        {item.label}
      </Checkbox>
    ));

  const [selected, setSelected] = React.useState(1);

  const [value, setValue] = React.useState({ min: 1, max: 3 });
  const marks = {
    0: '$0',
    1: '$50',
    2: '$100',
    3: '$150',
    4: '$200',
  };

  return (
    <Box height="720px">
      <SidePanel onCloseButtonClick={() => {}}>
        <SidePanel.Header title="Filter" />
        <Accordion
          skin="light"
          hideShadow
          size="small"
          items={[
            accordionItemBuilder({
              title: 'Collection',
              children: (
                <Box direction="vertical" gap="12px">
                  <Checkbox
                    checked={isAllSelected}
                    indeterminate={!isAllSelected && !isAllDeselected}
                    onChange={() => toggleCheckedAll(!isAllSelected)}
                  >
                    All collections
                  </Checkbox>
                  {renderCheckboxes()}
                </Box>
              ),
            }),
            accordionItemBuilder({
              title: 'Inventory',
              children: (
                <RadioGroup
                  value={selected}
                  onChange={(value) => setSelected(Number(value))}
                >
                  <RadioGroup.Radio value={1}>All products</RadioGroup.Radio>
                  <RadioGroup.Radio value={2}>In stock</RadioGroup.Radio>
                  <RadioGroup.Radio value={3}>Out of stock</RadioGroup.Radio>
                </RadioGroup>
              ),
            }),
            accordionItemBuilder({
              title: 'Price',
              children: (
                <Slider
                  onChange={(val) => setValue({ min: val[0], max: val[1] })}
                  marks={marks}
                  min={0}
                  max={4}
                  step={1}
                  value={[value.min, value.max]}
                />
              ),
            }),
          ]}
        />
        <SidePanel.Footer>
          <Button priority="secondary" fullWidth>
            Apply
          </Button>
        </SidePanel.Footer>
      </SidePanel>
    </Box>
  );
};
```

#### In FAQs

Use accordion in FAQs or similar content-heavy sections. It improves scanning and navigation across related content sections.

```jsx
<Layout>
  <Cell span={12}>
    <Card hideOverflow>
      <Card.Header title="FAQ"></Card.Header>
      <Card.Divider />
      <Accordion
        size="tiny"
        skin="light"
        hideShadow
        items={[
          accordionItemBuilder({
            title: (
              <Text size="small" weight="normal">
                What are Core Web Vitals?
              </Text>
            ),
            children: (
              <Box direction="vertical" width="100%" gap="SP1">
                <Text size="small" secondary>
                  Core Web Vitals are three performance factors Google takes
                  into account for SEO ranking: Largest Contentful Paint,
                  Cumulative Layout Shift, and First Input Delay. When measured
                  in a lab, they don’t affect your SEO directly.
                </Text>
                <TextButton
                  size="small"
                  suffixIcon={<Icons.ExternalLinkSmall />}
                  underline="onHover"
                >
                  Learn more about Core Web Vitals
                </TextButton>
              </Box>
            ),
          }),
          accordionItemBuilder({
            title: (
              <Text size="small" weight="normal">
                Why are my scores different for desktop and mobile?
              </Text>
            ),
            children: (
              <Box direction="vertical" width="100%" gap="SP1">
                <Text size="small" secondary>
                  PageSpeed scores for mobile are often lower than for desktop.
                  That’s because mobile devices have slower processors and take
                  more time to resize texts and images. Lab settings are another
                  reason: Google’s mobile test is on a simulated 3G connection,
                  which is different from the 4G and Wifi connections most
                  visitors use to access your site.
                </Text>
                <TextButton
                  size="small"
                  suffixIcon={<Icons.ExternalLinkSmall />}
                  underline="onHover"
                >
                  Learn more about scores
                </TextButton>
              </Box>
            ),
          }),
          accordionItemBuilder({
            title: (
              <Text size="small" weight="normal">
                Why is Google’s simulation different from real visitor
                experience?
              </Text>
            ),
            children: (
              <Text size="small" secondary>
                The measurements above are based on the experience of people who
                have actually visited your site over the last 30 day period.
                What Google does is check your site’s average metrics in lab
                conditions, using a very basic network and device. This means
                Google’s estimate is probably different from what your actual
                site visitors experience.
              </Text>
            ),
          }),
          accordionItemBuilder({
            title: (
              <Text size="small" weight="normal">
                Why does my score change from one test to another?
              </Text>
            ),
            children: (
              <Box direction="vertical" width="100%" gap="SP1">
                <Text size="small" secondary>
                  This can be due to a number of factors, including local
                  networks and CPU load at the time of the test, as well as
                  changes to your site's home page. In most cases, changes to
                  the score are minimal.
                </Text>
                <TextButton
                  size="small"
                  suffixIcon={<Icons.ExternalLinkSmall />}
                  underline="onHover"
                >
                  Learn more about scores
                </TextButton>
              </Box>
            ),
          }),
          accordionItemBuilder({
            title: (
              <Text size="small" weight="normal">
                Does my PageSpeed score affect my SEO ranking?
              </Text>
            ),
            children: (
              <Box direction="vertical" width="100%" gap="SP1">
                <Text size="small" secondary>
                  Not exactly. Even though site speed is one of the many factors
                  affecting your SEO ranking, only data collected from real user
                  sessions counts. The PageSpeed score you see here is based on
                  a lab test and doesn’t affect your site’s SEO directly.
                </Text>
                <TextButton
                  size="small"
                  suffixIcon={<Icons.ExternalLinkSmall />}
                  underline="onHover"
                >
                  Learn more about SEO ranking
                </TextButton>
              </Box>
            ),
          }),
        ]}
      />
    </Card>
  </Cell>
</Layout>;
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `contentPadding` | `"none"` | — | Targets Accordion Item content padding. When not provided, uses default paddings. |
| `dataHook` | `string` | — | Applied as data-hook HTML attribute that can be used to create driver in testing. |
| `hideShadow` | `boolean` | `false` | Hide Accordion shadow effect. |
| `horizontalPadding` | `"small" \| "tiny" \| "medium" \| "large" \| "none" \| "xxTiny" \| "xTiny"` | — | Change horizontal padding. |
| `items` | `AccordionItemType[]` | — | Provide items - Available items props: ```javascript { render?: func; title?: React.ReactNode; subtitle?: React.ReactNode; icon?: React.ReactNode; children?: React.ReactNode; expandLabel?: React.ReactNode; collapseLabel?: React.ReactNode; showLabel?: 'hover' \| 'always'; buttonType?: 'textButton' \| 'button' \| 'node'; disabled?: boolean; onToggle?: React.MouseEventHandler<HTMLElement>; onMouseEnter?: React.MouseEventHandler<HTMLElement>; onMouseLeave?: React.MouseEventHandler<HTMLElement>; open?: boolean; initiallyOpen?: boolean; } ``` |
| `multiple` | `boolean` | `false` | Specifies whether multiple items can be expanded at the same time. When `false`, expanding an item collapses the one that's open. |
| `onAnimationEnter` | `() => void` | — | Callback fired immediately after the animation is started. |
| `onAnimationExit` | `() => void` | — | Callback fired immediately after the animation is ended. |
| `ref` | `null \| string \| (instance: AccordionComponent \| null) => void \| RefObject<AccordionComponent>` | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). |
| `size` | `"small" \| "tiny" \| "medium" \| "large" \| "xxTiny" \| "xTiny"` | `'small'` | Change items size. |
| `skin` | `"standard" \| "light" \| "neutral"` | — | Accordion skin color. |
| `titleSize` | `"small" \| "medium"` | `'medium'` | Accordion title and subtitle size. |
| `transitionSpeed` | `"medium" \| "slow" \| "fast"` | `'medium'` | Change expand and collapse animation speed. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `getItemTitleAt` | Gets the title by item index |
| `getItemSubtitleAt` | Gets the subtitle by item index |
| `isIconExistsAt` | use 'isPrefixExistsAt' instead |
| `isPrefixExistsAt` | Checks whether prefix exists at item index |
| `isSuffixExistsAt` | Checks whether suffix exists at item index |
| `isItemExpandedAt` | Checks whether an item is expanded at index |
| `isItemExpandedByTitle` | Checks whether an item is expanded by title |
| `clickToggleButtonAt` | Clicks toggle button at item index |
| `clickItemAt` | Clicks item at index |
| `clickItemByTitle` | Clicks item by title |
| `getToggleButtonLabelAt` | Gets toggle button label at item index |
| `getTransitionSpeed` | Gets transition speed |
| `getSkin` | Returns skin |
| `getHorizontalPadding` | Returns size of horizontal padding |
| `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.335.0** (2026-10-12) — maintenance release, no component-specific changes
- **1.333.1** (2026-10-07) — fix: passing `onToggle` to an item no longer freezes it — the item now expands and collapses on click and still calls `onToggle`. An item becomes controlled only when both `onToggle` and `open` are passed. ([#17380](invalid-url))
- **1.331.0** (2026-10-01) — maintenance release, no component-specific changes
- **1.329.0** (2026-09-24) — maintenance release, no component-specific changes
- **1.328.0** (2026-09-22) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.324.0** (2026-09-14) — maintenance release, no component-specific changes
- **1.318.0** (2026-08-28) — feat: the caret rotation and the content entrance animate on expand and collapse in Harmony (odeditor), following `transitionSpeed`. ([#16928](invalid-url))
- **1.315.0** (2026-08-20) — fix: with `buttonType="node"`, the custom toggle icon no longer sits slightly above the vertical center of the header row. ([#16850](invalid-url))
- **1.313.1** (2026-08-18) — fix: suffix/prefix icons and the toggle caret now align vertically when used together. ([#16827](invalid-url)) — has visual changes
- **1.313.1** (2026-08-18) — fix: restored the `Accordion` type export used for typing refs (e.g. `useRef<Accordion>(null)`), which was lost when the component was wrapped with `withDefaultProps`. ([#16823](invalid-url))
- **1.312.0** (2026-08-14) — fix: the `light` and `neutral` skins no longer render an opaque background in Studio 2.0 (odeditor-dark) — headers and content are transparent in every skin. ([#16773](invalid-url)) — has visual changes
- **1.310.1** (2026-08-11) — fix: the caret icon stays visible in high contrast mode. ([#16759](invalid-url))
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.305.1** (2026-07-30) — fix: item dividers in Studio 2.0 (odeditor-dark) now use `--wds-divider-fill-dark` (`#3A3A3B`) instead of the default border color, fixing the doubled-divider look. ([#16657](invalid-url))
- **1.305.1** (2026-07-30) — fix: restore Studio 2.0 (odeditor-dark) horizontal paddings to the component spec — 16px for the default `horizontalPadding="large"` and 12px for `"medium"`; other themes keep their current rendering. ([#16654](invalid-url)) — has visual changes
- **1.305.0** (2026-07-28) — fix: honor contentPadding="none" under skin light + hideShadow ([#16640](invalid-url)) — has visual changes
- **1.305.0** (2026-07-28) — fix: caret rotation leaking into nested accordions ([#16645](invalid-url)) — has visual changes
- **1.304.0** (2026-07-24) — feat: migrate to semantic classes + add expand/collapse animations ([#16589](invalid-url))
- **1.303.0** (2026-07-23) — fix: titleSize leaking into nested accordions ([#16612](invalid-url)) — has visual changes
- **1.299.0** (2026-07-17) — maintenance release, no component-specific changes
- **1.298.0** (2026-07-14) — breaking: visual changes for Harmony and Studio themes ([#16508](invalid-url)) — has visual changes
- **1.294.0** (2026-07-02) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.289.0** (2026-06-17) — maintenance release, no component-specific changes
- **1.280.0** (2026-05-19) — feat: add xTiny and xxTiny horizontal and vertical padding values ([#16272](invalid-url)) — has visual changes
- **1.277.0** (2026-05-07) — maintenance release, no component-specific changes
- **1.273.0** (2026-04-30) — maintenance release, no component-specific changes
- **1.271.0** (2026-04-22) — maintenance release, no component-specific changes
- **1.269.0** (2026-04-15) — 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.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.242.0** (2025-12-19) — maintenance release, no component-specific changes
- **1.241.0** (2025-12-17) — maintenance release, no component-specific changes
- **1.229.0** (2025-11-18) — feat: new isItemExpandedByTitle testkit method ([#15521](invalid-url))
- **1.228.0** (2025-11-18) — feat: new clickItemByTitle testkit method ([#15505](invalid-url))
- **1.218.0** (2025-09-09) — breaking: adjust fill colors & border radius ([#15292](invalid-url))
- **1.212.0** (2025-08-11) — maintenance release, no component-specific changes
- **1.205.0** (2025-07-15) — maintenance release, no component-specific changes
- **1.201.0** (2025-06-23) — maintenance release, no component-specific changes
- **1.188.0** (2025-05-12) — feat: add titleSize prop ([#14757](invalid-url))
- **1.181.0** (2025-04-18) — maintenance release, no component-specific changes
- **1.172.1** (2025-03-21) — maintenance release, no component-specific changes
- **1.169.0** (2025-03-10) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.119.0** (2024-07-31) — maintenance release, no component-specific changes
- **1.118.0** (2024-07-30) — fix: hover moved into CSS ([#13987](invalid-url))
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.101.0** (2024-04-12) — breaking: tokenized ([#13571](invalid-url))
- **1.93.1** (2024-02-12) — fix: added missing container for toggle button node ([#13298](invalid-url))
- **1.93.0** (2024-02-08) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes