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

## Article: SelectableAccordion Component

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

## Article Content:

# SelectableAccordion

_Components/Lists_

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

## Overview

```jsx
() => {
  const [selected, setSelected] = React.useState(1);

  return (
    <SelectableAccordion
      type="toggle"
      items={[
        {
          title: 'Moderate posts for sensitive content',
          subtitle: 'Choose which new posts to review for sensitive content',
          content: (
            <FormField label="Which posts would you like to moderate?">
              <RadioGroup
                value={selected}
                onChange={(newValue) => setSelected(Number(newValue))}
              >
                <RadioGroup.Radio value={1}>All new posts</RadioGroup.Radio>
                <RadioGroup.Radio value={2}>
                  Posts with links, images and videos
                </RadioGroup.Radio>
                <RadioGroup.Radio value={3}>
                  Posts with images and videos only
                </RadioGroup.Radio>
                <RadioGroup.Radio value={4}>
                  Posts with links only
                </RadioGroup.Radio>
              </RadioGroup>
            </FormField>
          ),
        },
        {
          title: 'Moderate posts with certain words',
          subtitle: 'Add words you’d like to moderate',
          content: (
            <FormField
              label="Spam words"
              statusMessage="Use commas to separate spam words (e.g., Guarantee, free, loan)."
            >
              <InputArea
                placeholder="Add words you want to moderate here"
                rows={4}
                resizable
              />
            </FormField>
          ),
        },
      ]}
    />
  );
};
```

Selectable accordion is a list of interactive items, which show and collapse additional content when they are selected and deselected.

### Do

- Use it to organize complex settings by grouping them into collapsible sections.
- Use it to show additional information or settings only when an item is selected.

### Don't

- Don't use it to display a single item. Use `<Collapse/>` mechanism instead.
- Don't use it for items that have no additional information to expand. Use `<Checkbox/>` or `<ToggleSwitch/>` instead.

### Feature examples

#### Structure

Selectable accordion consists of clickable items and their inner content, which is expanded when an item is selected.

Inner content areas accept any components inside.

```jsx
<SelectableAccordion
  type="toggle"
  items={[
    {
      title: 'First item',
      initiallyOpen: true,
      content: (
        <StorybookComponents.Placeholder>
          First item content
        </StorybookComponents.Placeholder>
      ),
    },
    {
      title: 'Second item',
      content: (
        <StorybookComponents.Placeholder>
          Second item content
        </StorybookComponents.Placeholder>
      ),
    },
  ]}
/>;
```

#### Item tooltip

Give an item `tooltipContent` to wrap it in a tooltip. Its main use is explaining why an item is `disabled`, so people are not left guessing why they cannot select it.

Say what would make the option available rather than restating that it is unavailable.

```jsx
<SelectableAccordion
  type="radio"
  ariaLabel="Shipping method"
  items={[
    {
      title: 'Standard shipping',
      subtitle: 'Arrives in 3-5 business days',
      content: (
        <StorybookComponents.Placeholder>
          Standard shipping options
        </StorybookComponents.Placeholder>
      ),
    },
    {
      title: 'Same-day delivery',
      subtitle: 'Arrives today',
      disabled: true,
      tooltipContent:
        'Available for orders placed before 11:00 in selected cities.',
      content: (
        <StorybookComponents.Placeholder>
          Same-day delivery options
        </StorybookComponents.Placeholder>
      ),
    },
  ]}
/>;
```

#### Type

Change the type of items' controller with `type` prop. It supports 2 options:

- `checkbox` - use when multiple items can be selected at once.
- `toggle` - use when items (or features) are enabled / disabled.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <SelectableAccordion
    type="checkbox"
    items={[
      {
        title: 'Checkbox',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Checkbox',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
  <SelectableAccordion
    type="toggle"
    items={[
      {
        title: 'Toggle',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Toggle',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
</StorybookComponents.Stack>;
```

#### Vertical padding

Control vertical padding of selectable accordion items with `verticalPadding` prop:

- `medium` is a larger padding that emphasizes a few items.
- `small` (default) is a standard padding for common cases.
- `tiny` is a compact padding that displays more items in a smaller space.

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

```jsx
<StorybookComponents.Stack flexDirection="column">
  <SelectableAccordion
    verticalPadding="medium"
    type="toggle"
    items={[
      {
        title: 'Medium',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Medium',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
  <SelectableAccordion
    verticalPadding="small"
    type="toggle"
    items={[
      {
        title: 'Small',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Small',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
  <SelectableAccordion
    verticalPadding="tiny"
    type="toggle"
    items={[
      {
        title: 'Tiny',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Tiny',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
</StorybookComponents.Stack>;
```

#### Title and subtitle

Describe selectable accordion items with `title` and `subtitle` props.

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

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

#### Initially open item

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

Control which items are open on page load with `initiallyOpen` prop.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <SelectableAccordion
    type="toggle"
    items={[
      {
        title: 'Default',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Initially open',
        initiallyOpen: true,
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
</StorybookComponents.Stack>;
```

#### Disabled item

Disable a selectable accordion item with `disabled` prop.

Users will not be able to select or deselect it.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <SelectableAccordion
    type="toggle"
    items={[
      {
        title: 'Default',
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
      {
        title: 'Disabled',
        disabled: true,
        content: (
          <StorybookComponents.Placeholder>
            Item content
          </StorybookComponents.Placeholder>
        ),
      },
    ]}
  />
</StorybookComponents.Stack>;
```

### Developer examples

#### Programatically controlled item

Control the selectable accordion items programatically using `open` prop.

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

  return (
    <StorybookComponents.Stack flexDirection="column">
      <Box>
        <Button
          onClick={() => setFirstOptionOpen(!firstOptionOpen)}
          priority="secondary"
        >
          Select {firstOptionOpen ? 'second' : 'first'} item
        </Button>
      </Box>
      <SelectableAccordion
        type="checkbox"
        items={[
          {
            open: firstOptionOpen,
            title: 'First item',
            content: (
              <StorybookComponents.Placeholder>
                Item content
              </StorybookComponents.Placeholder>
            ),
          },
          {
            title: 'Second item',
            content: (
              <StorybookComponents.Placeholder>
                Item content
              </StorybookComponents.Placeholder>
            ),
            open: !firstOptionOpen,
          },
        ]}
      />
    </StorybookComponents.Stack>
  );
};
```

### Common use case examples

#### In long settings pages

A selectable accordion on a settings page helps save space and reduces mental load for the user.

This is because the UI displays only the settings that are relevant at a time.

```jsx
() => {
  const [selectedOptions, setSelectedOptions] = React.useState([]);

  return (
    <Card hideOverflow>
      <Card.Header
        title="Benefits"
        subtitle="Set up how your benefits work in this plan."
        suffix=<Button size="small" priority="secondary">
          Connect More Benefits
        </Button>
      ></Card.Header>
      <Card.Divider />
      <SelectableAccordion
        verticalPadding="medium"
        type="checkbox"
        items={[
          {
            title: 'Bookings Services',
            subtitle:
              'Offer services as a membership or package with this plan.',
            content: (
              <Layout cols={3}>
                <FormField label="Total sessions">
                  <Dropdown
                    initialSelectedId={0}
                    options={[{ id: 0, value: 'Limited number' }]}
                  />
                </FormField>
                <FormField label="Amount">
                  <NumberInput
                    placeholder="0"
                    suffix={<Input.Affix>sessions</Input.Affix>}
                  />
                </FormField>
                <FormField label="Period">
                  <Dropdown
                    initialSelectedId={0}
                    options={[{ id: 0, value: 'per billing cycle' }]}
                  />
                </FormField>
              </Layout>
            ),
          },
          {
            title: 'Online Programs',
            subtitle:
              'Allow participation in different programs with this plan.',
            content: (
              <FormField label="Select online programs">
                <MultiSelectCheckbox
                  placeholder="Select"
                  options={[
                    { value: 'Fitness 2023', id: 'Fitness2023' },
                    { value: 'Getting fit is easy', id: 'GettingFitIsEasy' },
                    { value: 'Fitness for newbies', id: 'FitnessForNewbies' },
                    { value: 'Fit mom at home', id: 'FitMomAtHome' },
                    {
                      value: 'Advanced fitness at home',
                      id: 'AdvancedFitnessAtHome',
                    },
                  ]}
                  selectedOptions={selectedOptions}
                  onSelect={(option) =>
                    setSelectedOptions([...selectedOptions, option])
                  }
                  onDeselect={(option) =>
                    setSelectedOptions(
                      selectedOptions.filter((item) => item !== option),
                    )
                  }
                  popoverProps={{ appendTo: 'window' }}
                />
              </FormField>
            ),
          },
        ]}
      />
    </Card>
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `ariaLabel` | `string` | — | Sets an accessible name for the radio group. Applied only when `type` is `'radio'`. |
| `ariaLabelledby` | `string` | — | Sets the id of the element that labels the radio group. Applied only when `type` is `'radio'`. |
| `dataHook` | `string` | — | Applied as data-hook HTML attribute that can be used in the tests. |
| `items` | `SelectableAccordionItemProps[]` | — | An array of Accordion items: - `title`: A title of the item - `subtitle`: An optional second row of the header - `content`: A content of the item - `initiallyOpen`: Whether the item is initially open - `open`: Whether the item is open - `disabled`: Whether the item is disabled - `tooltipContent`: Content of a tooltip shown when hovering over the item (e.g. to explain a disabled item) - `onClick`: A callback which is invoked when item's selection is changed |
| `onSelectionChanged` | `(selectedIds: number[]) => void` | — | A callback which is invoked every time the selection is changed. |
| `type` | `"checkbox" \| "radio" \| "toggle"` | `'radio'` | A type can be ether radio, checkbox, or toggle, which affects the way an accordion item is selected. |
| `verticalPadding` | `"small" \| "tiny" \| "medium"` | — | Extra space on top and bottom of selectable accordion item. |

## Testkit

No testkit for this component — it doesn't expose a unidriver testkit.

## 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.330.3** (2026-09-29) — maintenance release, no component-specific changes
- **1.330.0** (2026-09-28) — 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.321.0** (2026-09-08) — feat: with `type="radio"` the items now form a real radio group. The root has `role="radiogroup"` and takes new `ariaLabel` / `ariaLabelledby` props, each radio is named by its item title, arrow keys move between items, and focus lands on the selected radio. ([#17029](invalid-url))
- **1.317.0** (2026-08-26) — feat: items accept a `tooltipContent` prop that shows a tooltip on hover, useful for explaining why an item is disabled. Disabled items now match Accordion's disabled appearance, with the background and label greyed out. ([#16880](invalid-url)) — has visual changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.306.0** (2026-07-31) — 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.277.0** (2026-05-07) — maintenance release, no component-specific changes
- **1.272.0** (2026-04-27) — maintenance release, no component-specific changes
- **1.271.0** (2026-04-22) — 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.250.0** (2026-01-27) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **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.93.0** (2024-02-08) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes