Card.Header

Components/Layout/Card

Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/card-header

Overview

Copy

Card headers are used to state the card's topic. It's an optional compound component of cards.

Do

  • Use it to show the topic of the card or a summary of its content.
  • Use it to help users scan the page and find relevant info quicker.
  • Use the suffix to show actions that apply to the whole card.

Don't

  • Don't use it outside of the <Card/> component.

Feature examples

Structure

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.

Copy

Title and subtitle

Use a short title so the card's topic stands out and is easier to scan.

Add a subtitle to give further explanation.

Copy

Suffix

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)
Copy

Mobile examples

Mobile header actions

<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.

Copy

Common use case examples

Collapsible cards

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.

Copy

Add links within the subtitle by using an inline <TextButton/>.

Copy

Accessibility examples

Control heading hierarchy

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.

Copy

Code

Copy

Props

NameTypeDefaultDescription
dataHookstring—Applies a data-hook HTML attribute to be used in the tests.
subtitleReactNode—Sets card subtitle text value. Subtitle can also be overridden to any other component.
suffixReactNode—Adds an empty container on the right side of a header. Used to store action buttons or other components.
titleReactNode—Sets card title text value. Title can also be overridden to any other component.

Testkit

Import the driver matching your test environment:

Copy

Driver methods

MethodDescription
titleReturns title text.
subtitleReturns subtitle text.
existsChecks whether the component found with the given data hook.
elementGets the component root element.
clickClicks on the component root element.
baseReturns UniDriver for the base element.

Changelog

No released changes have been recorded for this component.

Last updated: 20 October 2026

Did this help?