> 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: Card.Subheader Component

## Article: Card.Subheader Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/layout/card/card-subheader-component.md

## Article Content:

# Card.Subheader

_Components/Layout/Card_

> **Deprecated.** Card.Subheader is deprecated and will be removed in the next major version. Please use SectionHeader instead.

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

## Overview

```jsx
<Card.Subheader
  title="Best sellers"
  suffix={
    <TextButton size="small" prefixIcon={<Icons.AddSmall />}>
      Add Product
    </TextButton>
  }
/>;
```

The card subheader divides card content into sections. It's an optional compound component of the `<Card/>`.

### Do

- Group related content under subheaders within a card.

### Don't

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

### Feature examples

#### Structure

Card subheaders consist of 2 parts:

- `title` labels contents under the subheader.
- `suffix` is a container for an action button or other components.

Note that both parts are optional and their position is fixed.

```jsx
<Card.Subheader
  title="Title"
  suffix={
    <StorybookComponents.Placeholder width="50px" height="20px">
      Suffix
    </StorybookComponents.Placeholder>
  }
/>;
```

#### Skin

Control the background color with the `skin`:

- `standard` is the default and is used in most cases.
- `neutral` is used to minimize the component's visual weight.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Card.Subheader skin="standard" title="Standard" />
  <Card>
    <Card.Subheader skin="neutral" title="Neutral" />
  </Card>
</StorybookComponents.Stack>;
```

#### Title

Use `title` to summarize the content below the subheader.

```jsx
<Card.Subheader title="Title" />;
```

#### Suffix

Use a `suffix` container to add info or actions that apply to the card content.

A variety of components can be used in the suffix:

- `<Button/>`
- `<TextButton/>`
- `<IconButton/>`
- `<Text/>`
- `<InfoIcon/>`
- Other components

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Card.Subheader
    title="Title"
    suffix={
      <Button size="tiny" priority="secondary">
        Suffix
      </Button>
    }
  />
  <Card.Subheader
    title="Title"
    suffix={
      <TextButton size="tiny" priority="secondary">
        Suffix
      </TextButton>
    }
  />
  <Card.Subheader
    title="Title"
    suffix={
      <IconButton size="tiny" priority="secondary">
        <Icons.MoreSmall />
      </IconButton>
    }
  />
  <Card.Subheader title="Title" suffix={<Text size="tiny">Suffix</Text>} />
  <Card.Subheader
    title="Title"
    suffix={<InfoIcon content="Context info" />}
  />
</StorybookComponents.Stack>;
```

### Common use case examples

#### Grouping card content

Use card subheaders to organize card info into categories. It will make the whole card easier to scan.

```jsx
() => {
  const items = [
    {
      sectionTitle: (
        <Text weight="normal" size="small">
          Monday, February 7
        </Text>
      ),
    },
    {
      time: '7:00 PM - 9:00 PM',
      event: 'Registration & reception',
    },
    {
      sectionTitle: (
        <Text weight="normal" size="small">
          Tuesday, February 8
        </Text>
      ),
    },
    {
      time: '8:00 AM - 10:00 AM',
      event: 'Keynote address by Steven H. Kastner',
      divider: true,
    },
    {
      time: '10:00 AM - 1:00 PM',
      event: 'Break & networking',
      divider: true,
    },
    {
      time: '1:00 PM - 3:00 PM',
      event: 'Keynote address by Linda Contreras',
      divider: true,
    },
    {
      time: '7:00 PM - 9:00 PM',
      event: 'Evening reception',
    },
    {
      sectionTitle: (
        <Text weight="normal" size="small">
          Wednesday, February 9
        </Text>
      ),
    },
    {
      time: '8:00 AM - 10:00 AM',
      event: 'Keynote address by Susan W. Eaton',
      divider: true,
    },
    {
      time: '10:00 AM - 1:00 PM',
      event: 'Keynote address by Bjorn Rettig',
    },
  ];

  const pirmaryAction = {
    text: 'Edit',
    onClick: () => ({}),
  };

  const secondaryActions = [
    {
      text: 'Hide',
      icon: <Icons.HiddenSmall />,
      onClick: () => ({}),
    },
    {
      text: 'Cancel',
      icon: <Icons.BlockSmall />,
      onClick: () => ({}),
    },
    {
      text: 'Delete',
      icon: <Icons.DeleteSmall />,
      onClick: () => ({}),
    },
  ];

  const actionsList = (
    <TableActionCell
      primaryAction={pirmaryAction}
      secondaryActions={secondaryActions}
      numOfVisibleSecondaryActions={0}
      size="small"
    />
  );

  const primaryAction = (
    <Button size="small" priority="secondary" prefixIcon={<Icons.AddSmall />}>
      Add Item
    </Button>
  );

  return (
    <Card hideOverflow>
      <Card.Header
        title="Event schedule"
        subtitle="Build a schedule to keep guests informed throughout your event."
        suffix={primaryAction}
      />
      {items.map((params) => {
        if (params.sectionTitle) {
          return <Card.Subheader title={params.sectionTitle} skin="neutral" />;
        }
        return (
          <TableListItem
            showDivider={params.divider}
            onClick={() => {}}
            options={[
              { value: <Text size="small">{params.time}</Text>, width: '25%' },
              { value: <Text size="small">{params.event}</Text>, width: '50%' },
              { value: actionsList },
            ]}
          />
        );
      })}
    </Card>
  );
};
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute to be used in the tests. |
| `skin` | `"standard" \| "neutral"` | `'standard'` | Controls the background color of a subheader. |
| `suffix` | `ReactNode` | — | Adds an empty container on the right side of a subheader. Commonly used to store action buttons or an info icon. |
| `title` *(required)* | `ReactNode` | — | Sets a title text value. Title can also be overridden to any other component. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `title` | Returns title text. |
| `titleNode` | Returns title node. |
| `suffixNode` | Returns suffix node. |
| `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

No released changes have been recorded for this component.