Components/Layout/Card
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/card-header
Card headers are used to state the card's topic. It's an optional compound component of cards.
<Card/> component.Card headers consist of 3 parts:
title is the main text of the card, showing its main topic.subtitle is an additional explanation or description of the card's topic.suffix is a container for buttons, links, or other components.All 3 parts are optional and their position is fixed.
Use a short title so the card's topic stands out and is easier to scan.
Add a subtitle to give further explanation.
Use a suffix container to add actions that apply to the whole card.
A variety of components can be used in the suffix, including:
<Button/><TextButton/><IconButton/><ToggleSwitch/> (use for collapsible cards)<Card.Header/> renders whatever you pass to suffix next to the title, at every screen width, so on a narrow screen the actions squeeze the title and subtitle into a thin column. Read mobile from WixDesignSystemContext and move the actions out of the suffix on mobile instead.
On mobile, leave suffix empty so the title and subtitle take the full width, and render the actions in a <Card.Content/> right below the header. Make the primary action fullWidth for a large touch target, and collapse the secondary actions into a More <IconButton/> with a <PopoverMenu/> to its left. The desktop layout stays as it is.
To see the change, toggle 'Enable mobile support' in the top bar of Storybook.
Use a <ToggleSwitch/> or a <TextButton/> (e.g., "Show more" or "Show less") in the header suffix to let users expand and collapse the card.
Add links within the subtitle by using an inline <TextButton/>.
If a card appears directly below the page title (H1) with no page section title (H2) in between, change card title to H2 using as prop.
| Name | Type | Default | Description |
|---|---|---|---|
dataHook | string | — | Applies a data-hook HTML attribute to be used in the tests. |
subtitle | ReactNode | — | Sets card subtitle text value. Subtitle can also be overridden to any other component. |
suffix | ReactNode | — | Adds an empty container on the right side of a header. Used to store action buttons or other components. |
title | ReactNode | — | Sets card title text value. Title can also be overridden to any other component. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
title | Returns title text. |
subtitle | Returns subtitle text. |
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. |
No released changes have been recorded for this component.
Last updated: 20 October 2026