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

## Article: AnalyticsSummaryCard Component

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

## Article Content:

# AnalyticsSummaryCard

_Components/Charts/Analyticssummary_

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

## Overview

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={169}
  title="Sessions"
  value="1,9K"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
/>;
```

Analytics Summary Card component provides a concise overview of key metrics, helping users quickly understand performance insights at a glance.

### Do

- Use short labels that are easy to read.
- Use it together with `<AnalyticsLayout/>` to control the layout.

### Don't

- Don't overcrowd the card with too much information.
- Don't add ambiguous metrics, to prevent misinterpretation.

### Feature examples

#### Footer

Add additional information to a card with `footer`.

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={169}
  onChartHover={() => console.log('on chart hover')}
  title="Sessions"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
  value="1,9K"
  footer={
    <div>
      <div>
        <Text>This is footer text </Text>
      </div>
      <div>
        <Button size="tiny">Click Here </Button>
      </div>
    </div>
  }
/>;
```

#### Trend

The `trend` indicates the change of the value in percentage.

It has 2 modes:

- **Positive** - colored green with arrow upwards
- **Negative** - colored red with arrow downwards.

If there's no change in value, trend won't be displayed.

```jsx
<div>
  <div>
    <AnalyticsSummaryCard
      chartColorHex="#3899ec"
      chartData={[
        {
          label: new Date('2020-09-03T21:00:00.000Z'),
          value: 100,
        },
        {
          label: new Date('2020-09-04T21:00:00.000Z'),
          value: 17,
        },
        {
          label: new Date('2020-09-05T21:00:00.000Z'),
          value: 18,
        },
      ]}
      chartWidth={169}
      onChartHover={() => console.log('on chart hover')}
      trend={12}
      isTrendVisible={true}
      title="Sessions"
      getChartTooltipContent={(index) => (
        <span style={{ color: '#ffffff' }}>{index}</span>
      )}
      value="1,9K"
    />
  </div>
  <br />
  <br />
  <div>
    <AnalyticsSummaryCard
      chartColorHex="#3899ec"
      chartData={[
        {
          label: new Date('2020-09-03T21:00:00.000Z'),
          value: 100,
        },
        {
          label: new Date('2020-09-04T21:00:00.000Z'),
          value: 17,
        },
        {
          label: new Date('2020-09-05T21:00:00.000Z'),
          value: 18,
        },
      ]}
      chartWidth={169}
      onChartHover={() => console.log('on chart hover')}
      trend={-12}
      isTrendVisible={true}
      title="Sessions"
      getChartTooltipContent={(index) => (
        <span style={{ color: '#ffffff' }}>{index}</span>
      )}
      value="1,9K"
    />
  </div>
</div>;
```

#### Action Button

Summary card can have action button inside to assist with any action needed, since it's a `node`.

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={169}
  ctaButton={
    <IconButton size="tiny" priority="secondary">
      <Icons.Refresh />
    </IconButton>
  }
  onCTAClick={() => console.log('refresh click')}
  onChartHover={() => console.log('on chart hover')}
  title="Sessions"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
  value="1,9K"
/>;
```

#### Clickable Card

Control is a card is clickable with `onClick`.

```jsx
<div>
  <div>
    <AnalyticsSummaryCard
      chartColorHex="#3899ec"
      chartData={[
        {
          label: new Date('2020-09-03T21:00:00.000Z'),
          value: 100,
        },
        {
          label: new Date('2020-09-04T21:00:00.000Z'),
          value: 17,
        },
        {
          label: new Date('2020-09-05T21:00:00.000Z'),
          value: 18,
        },
      ]}
      chartWidth={169}
      onChartHover={() => console.log('on chart hover')}
      onClick={() => console.log('general click')}
      title="Clickable card"
      getChartTooltipContent={(index) => (
        <span style={{ color: '#ffffff' }}>{index}</span>
      )}
      value="1,9K"
    />
  </div>
  <br />
  <br />
  <div>
    <AnalyticsSummaryCard
      chartColorHex="#3899ec"
      chartData={[
        {
          label: new Date('2020-09-03T21:00:00.000Z'),
          value: 100,
        },
        {
          label: new Date('2020-09-04T21:00:00.000Z'),
          value: 17,
        },
        {
          label: new Date('2020-09-05T21:00:00.000Z'),
          value: 18,
        },
      ]}
      chartWidth={169}
      onChartHover={() => console.log('on chart hover')}
      title="Not interactive card (default)"
      getChartTooltipContent={(index) => (
        <span style={{ color: '#ffffff' }}>{index}</span>
      )}
      value="1,9K"
    />
  </div>
</div>;
```

#### Loader

Card supports loading state. `<Loader/>` will replace the action button when it's actively loading. If the card is clickable it won't be actionable as long as the loader is active.

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={169}
  onChartHover={() => console.log('on chart hover')}
  title="Sessions"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
  isLoading={true}
  value="1,9K"
/>;
```

#### Sparkline Width

Control the sparkline width by pixels with `chartWidth` prop.

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={69}
  title="Sessions"
  value="1,9K"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
/>;
```

#### Border

Control the appearance of the component using the `border` prop.

Use this property to emphasize the separation between items.

```jsx
<div>
  <div>
    <AnalyticsSummaryCard
      border
      chartColorHex="#3899ec"
      chartData={[
        {
          label: new Date('2020-09-03T21:00:00.000Z'),
          value: 100,
        },
        {
          label: new Date('2020-09-04T21:00:00.000Z'),
          value: 17,
        },
        {
          label: new Date('2020-09-05T21:00:00.000Z'),
          value: 18,
        },
      ]}
      chartWidth={169}
      onChartHover={() => console.log('on chart hover')}
      trend={12}
      isTrendVisible={true}
      title="With border"
      getChartTooltipContent={(index) => (
        <span style={{ color: '#ffffff' }}>{index}</span>
      )}
      value="1,9K"
    />
  </div>
  <br />
  <br />
  <div>
    <AnalyticsSummaryCard
      chartColorHex="#3899ec"
      chartData={[
        {
          label: new Date('2020-09-03T21:00:00.000Z'),
          value: 100,
        },
        {
          label: new Date('2020-09-04T21:00:00.000Z'),
          value: 17,
        },
        {
          label: new Date('2020-09-05T21:00:00.000Z'),
          value: 18,
        },
      ]}
      chartWidth={169}
      onChartHover={() => console.log('on chart hover')}
      trend={-12}
      isTrendVisible={true}
      title="Without border"
      getChartTooltipContent={(index) => (
        <span style={{ color: '#ffffff' }}>{index}</span>
      )}
      value="1,9K"
    />
  </div>
</div>;
```

#### Horizontal padding

Control the padding of the card with `horizontalPadding` prop.

It supports three sizes:

- `large` (default)
- `medium`
- `small`

```jsx
<StorybookComponents.Stack flexDirection="column" gap="40px">
  <AnalyticsSummaryCard
    horizontalPadding="large"
    chartColorHex="#3899ec"
    chartData={[
      {
        label: new Date('2020-09-03T21:00:00.000Z'),
        value: 100,
      },
      {
        label: new Date('2020-09-04T21:00:00.000Z'),
        value: 17,
      },
      {
        label: new Date('2020-09-05T21:00:00.000Z'),
        value: 18,
      },
    ]}
    chartWidth={169}
    ctaButton={
      <IconButton size="tiny" priority="secondary">
        <Icons.Refresh />
      </IconButton>
    }
    onCTAClick={() => console.log('refresh click')}
    onChartHover={() => console.log('on chart hover')}
    title="Horizontal padding"
    getChartTooltipContent={(index) => (
      <span style={{ color: '#ffffff' }}>{index}</span>
    )}
    value="Large size"
  />
  <AnalyticsSummaryCard
    horizontalPadding="medium"
    chartColorHex="#3899ec"
    chartData={[
      {
        label: new Date('2020-09-03T21:00:00.000Z'),
        value: 100,
      },
      {
        label: new Date('2020-09-04T21:00:00.000Z'),
        value: 17,
      },
      {
        label: new Date('2020-09-05T21:00:00.000Z'),
        value: 18,
      },
    ]}
    chartWidth={169}
    ctaButton={
      <IconButton size="tiny" priority="secondary">
        <Icons.Refresh />
      </IconButton>
    }
    onCTAClick={() => console.log('refresh click')}
    onChartHover={() => console.log('on chart hover')}
    title="Horizontal padding"
    getChartTooltipContent={(index) => (
      <span style={{ color: '#ffffff' }}>{index}</span>
    )}
    value="Medium size"
  />
  <AnalyticsSummaryCard
    horizontalPadding="small"
    chartColorHex="#3899ec"
    chartData={[
      {
        label: new Date('2020-09-03T21:00:00.000Z'),
        value: 100,
      },
      {
        label: new Date('2020-09-04T21:00:00.000Z'),
        value: 17,
      },
      {
        label: new Date('2020-09-05T21:00:00.000Z'),
        value: 18,
      },
    ]}
    chartWidth={169}
    ctaButton={
      <IconButton size="tiny" priority="secondary">
        <Icons.Refresh />
      </IconButton>
    }
    onCTAClick={() => console.log('refresh click')}
    onChartHover={() => console.log('on chart hover')}
    title="Horizontal padding"
    getChartTooltipContent={(index) => (
      <span style={{ color: '#ffffff' }}>{index}</span>
    )}
    value="Small size"
  />
</StorybookComponents.Stack>;
```

### Developer examples

#### Tooltip On Title

If needed, the title can have `<Tooltip/>` to better explain the context.

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={169}
  title="Sessions"
  value="1,9K"
  titleTooltip="Site Sessions in your site. A session is a set of interactions made by visitors"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
/>;
```

#### Tooltip On Value

When value appears as abbreviated number, `<Tooltip/>` will appear on hover.

```jsx
<AnalyticsSummaryCard
  chartColorHex="#3899ec"
  chartData={[
    {
      label: new Date('2020-09-03T21:00:00.000Z'),
      value: 100,
    },
    {
      label: new Date('2020-09-04T21:00:00.000Z'),
      value: 17,
    },
    {
      label: new Date('2020-09-05T21:00:00.000Z'),
      value: 18,
    },
  ]}
  chartWidth={169}
  title="Sessions"
  value="1,9K"
  valueTooltip="1,951"
  getChartTooltipContent={(index) => (
    <span style={{ color: '#ffffff' }}>{index}</span>
  )}
/>;
```

## Code

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

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `alwaysShowCTA` | `boolean` | `false` | Always show CTA button. |
| `border` | `boolean` | `false` | Adds a border and corner radius. |
| `chartAnimationDuration` | `number` | `300` | Chart animation duration. |
| `chartColorHex` | `string` | — | Sets the color of the chart. |
| `chartData` *(required)* | `{ label: Date; value: number; }[]` | — | Sets the data points of the sparkline chart. Each point has a `label` date, plotted on the x axis, and a numeric `value`, plotted on the y axis. |
| `chartHighlightedStartingIndex` | `number` | — | Indicates the starting index of the highlighted area of the chart. |
| `chartWidth` | `number` | `69` | Chart width. |
| `ctaButton` | `ReactNode` | `null` | CTA button React Node. |
| `dataHook` | `string` | — | Applied as data-hook HTML attribute that can be used in the tests. |
| `disabled` | `boolean` | — |  |
| `footer` | `ReactNode` | `null` | Footer - node. |
| `getChartTooltipContent` | `(index: number) => ReactNode` | — | Chart tooltip content. |
| `horizontalPadding` | `"small" \| "medium" \| "large"` | `small` | Controls spacing size from left and right sides. |
| `invertedTrend` | `boolean` | — | Invert color and arrow direction of Trend. |
| `isLoading` | `boolean` | `false` | Whether component is loading. |
| `isTrendVisible` | `boolean` | `false` | Show/Hide trend. |
| `onBlur` | `(event: FocusEvent, triggers: Triggers) => void` | — |  |
| `onChartHover` | `(index: number) => void` | `noop` | Fires when chart is hovered. |
| `onClick` | `(event: MouseEvent<HTMLDivElement, MouseEvent>) => void` | — | Card would be clickable. |
| `onCTAClick` | `(event: MouseEvent<HTMLDivElement, MouseEvent>) => void` | — | Fires when CTA button is clicked. |
| `onFocus` | `(event: FocusEvent, triggers: Triggers) => void` | — |  |
| `ref` | `RefObject` | — |  |
| `title` | `string` | — | Text for the title. |
| `titleTooltip` | `string` | — | Text for title tooltip. |
| `trend` | `number` | — | A number to be displayed as the trend, a positive number is green with an arrow facing up and a negative number is red with an arrow facing down. |
| `value` *(required)* | `string` | — | Sets the main value of the card, displayed as a large heading. |
| `valueTooltip` | `string` | — | Text for value tooltip. |

## Testkit

Import the driver matching your test environment:

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

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

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

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

### Driver methods

| Method | Description |
| --- | --- |
| `clickCTA` | Click on CTA |
| `CTAExists` | Check if CTA exists |
| `CTAExistsWithoutHover` | Check if CTA exists |
| `isLoading` | Checks whether the Analytics are loading |
| `getValue` | returns the value text |
| `getValueTooltipText` | returns the value tooltip text |
| `getTitle` | returns the title text |
| `getTitleTooltipText` | returns the title tooltip text |
| `trendExists` | checks if trend exists |
| `getTrendvalue` | returns the trend value |
| `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

- **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.331.0** (2026-10-01) — maintenance release, no component-specific changes
- **1.330.3** (2026-09-29) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.324.0** (2026-09-14) — maintenance release, no component-specific changes
- **1.323.0** (2026-09-10) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.299.0** (2026-07-17) — breaking: reimagined Harmony redesign ([#16576](invalid-url)) — has visual 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.273.0** (2026-04-30) — maintenance release, no component-specific changes
- **1.272.0** (2026-04-27) — 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.258.0** (2026-02-23) — breaking: tokenizing ([#15946](invalid-url))
- **1.254.0** (2026-02-03) — maintenance release, no component-specific changes
- **1.247.2** (2026-01-21) — maintenance release, no component-specific changes
- **1.170.0** (2025-03-12) — fix: apply hover state only when the card is clickable ([#14600](invalid-url))
- **1.163.0** (2025-02-18) — maintenance release, no component-specific changes
- **1.157.0** (2025-01-30) — maintenance release, no component-specific changes
- **1.154.0** (2025-01-17) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.116.0** (2024-07-22) — 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