Components/Lists
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/accordion
Accordion is a list of items that shows and hides content in collapsible sections.
<Card/> with section titles instead.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).
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.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.Hide the inner content shadow with hideShadow prop.
Describe accordion items using title and subtitle props.
These containers also accept any component or a composition of multiple elements.
You can control the size of the title text:
titleSize sets the header text size: small or medium (default).
Add a prefix icon in front of an accordion item with icon prop.
Organize accordion items into groups using accordionSectionItemBuilder.
Define the show/hide action at the end of accordion item with buttonType prop. It can be:
textButton.button.node).Provide the labels for these actions, such as 'Show' and 'Hide' with expandLabel and collapseLabel props.
By default, all accordion items are closed until expanded by the user.
Open one or multiple accordion items from the start with initiallyOpen prop.
By default, only one accordion item can be open at a time.
Allow opening multiple items at once with multiple prop.
Disable an accordion item with disabled prop.
Users will not be able to expand or collapse it.
contentPadding controls the inner spacing around an accordion item's expanded content.
contentPadding="none": removes that inner padding so content starts at the container edge.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.
Component can be used in controlled mode by passing open and onToggle props to accordionItemBuilder.
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.
Use accordion in FAQs or similar content-heavy sections. It improves scanning and navigation across related content sections.
| 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. |
Import the driver matching your test environment:
| 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. |
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)transitionSpeed. (#16928)buttonType="node", the custom toggle icon no longer sits slightly above the vertical center of the header row. (#16850)Accordion type export used for typing refs (e.g. useRef<Accordion>(null)), which was lost when the component was wrapped with withDefaultProps. (#16823)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) — has visual changes--wds-divider-fill-dark (#3A3A3B) instead of the default border color, fixing the doubled-divider look. (#16657)horizontalPadding="large" and 12px for "medium"; other themes keep their current rendering. (#16654) — has visual changesLast updated: 22 October 2026