Count Card

A count card displays a count or key metric with an icon and label, for dashboards and summary views.

Revenue+12%$12,450.00Total users1,234

Overview

A count card highlights a single number or metric alongside an icon and a short label, so people can scan key figures at a glance. It’s built for dashboards and summary views, where several count cards sit side by side to summarize the state of a system.

Count cards can carry supporting details, such as a trend badge, a progress meter, or a sparkline, and a card-level action menu.

Usage

forge-count-card is built from named slots (icon, label, header-end, action, count, count-end, body, and full-width) plus theme to apply semantic color and no-border to remove the border. Every slot is optional, but include at least an icon and a count, and use the same slots across the cards on a page so they stay aligned in a grid. Put a forge-icon-button in action, not header-end, so its 48px touch target aligns correctly. Use a count card for a single metric; for a general container with a header, body, and footer, use a structured card instead.

Slot locations

1
IconAn icon in a styled container at the start of the header.

Revenue

2
LabelShort text that explains what the count represents.
+12%
3
Header endA badge or small accessory at the end of the header.
4
ActionA forge-icon-button for card-level actions, such as a menu.

$12,450.00

5
CountThe main value, shown prominently below the header.
USD
6
Count endUnits or secondary values after the count.
7
BodySupporting details below the count, like a progress meter or timestamp.
8
Full widthEdge-to-edge content below everything else, ideal for sparklines or progress indicators.

Rules

Do
Use the same slots across all count cards on a page, and always include an icon and a count.Keep labels short so they fit on one line.Put icon buttons in the action slot, not header-end.Use theme to convey meaning, like success or error, and pair color with text or an icon.Arrange several count cards in a responsive grid.
Don't
Don't use a count card for content that isn't a single metric.Don't put long text or complex layouts in the count slot.Don't rely on theme color alone to communicate status.Don't mix cards with different structures in the same row.

Basic usage

Slot an icon, a label, and a count. Add a badge to header-end for supporting context.

A count card with an icon, label, header badge, and count.

Multiple cards

Count cards work well in a grid to build a dashboard-style summary.

Four count cards in a responsive grid.

With full width

Use the full-width slot for content that spans the card’s width below the count, such as a sparkline or progress indicator.

A count card with a sparkline spanning its full width.

Additional body content

Use the body slot to add supporting content below the count, such as a progress meter or a last-updated time.

A count card with a trend badge, a meter, and a last-updated line in the body.

With menu

Use the action slot to add an icon button that opens a card-level menu.

A count card with an icon button that opens an options menu.

Themes

Set theme to primary, secondary, tertiary, success, error, warning, info, or info-secondary to apply semantic color. The default is none.

Count cards in each available theme.

A card component for displaying a count or metric with an icon and label.

import "@tylertech/forge/count-card";
Properties
PropertyAttributeTypeDefaultDescription
theme—CountCardTheme'none'The theme variant applied to the card.
noBorder—booleanfalseWhether to hide the card border.
Slots
NameDescription
iconThe icon displayed at the start of the card header.
labelThe label text displayed next to the icon.
header-endOptional content at the end of the header, ideal for badges or small accessories.
actionOptional slot for a `forge-icon-button`. Use this instead of `header-end` for icon buttons, as it provides proper alignment for the 48x48 touch target.
countThe main count or value displayed prominently below the header.
count-endOptional content displayed after the count, ideal for units or secondary values.
bodyOptional content below the count for additional details or secondary information.
full-widthOptional full-width content below the primary card content, ideal for sparklines, meters, or progress indicators.
CSS Custom Properties
NameDescription
--forge-count-card-icon-backgroundControls the background color of the icon container. Defaults to Forge's surface-container color.
--forge-count-card-icon-colorControls the color of the icon. Defaults to Forge's on-surface color.
--forge-count-card-icon-container-sizeControls the size of the icon container. Defaults to `32px`.
--forge-count-card-icon-sizeControls the size of the icon itself. Defaults to `24px`.
--forge-count-card-colorControls the text color of the label and count. Inherited from theme when a theme is applied.

Screen reader behavior

A count card has no role of its own: its icon, label, count, and other slotted content are read in order as ordinary content. Keep the label and count as plain text so they read naturally in sequence, such as “Revenue $12,450.00”. The label and count also show a tooltip with their full text.

Labeling

Always slot a text label so the count has context. Decorative icons in the icon slot don’t need a name, but an aria-label is required on any forge-icon-button in the action slot, such as “More options”.

<forge-count-card>
  <forge-icon slot="icon" name="people"></forge-icon>
  <span slot="label">Total users</span>
  <span slot="count">1,234</span>
  <forge-icon-button slot="action" aria-label="More options">
    <forge-icon name="more_vert"></forge-icon>
  </forge-icon-button>
</forge-count-card>

Color and contrast

Themes change the card’s colors, but color shouldn’t be the only signal of meaning. Pair a success, error, or warning theme with text or an icon, such as a badge reading “Over budget”.

Keyboard interaction

The card itself isn’t focusable. Interactive content you slot into it, such as the action icon button, is reachable in its normal order with Tab and activated with Enter or Space.

For a progress indicator in the body or full-width slot, such as forge-meter, give it an accessible label that describes what it measures. Add text alternatives for charts like sparklines.

Type to search the docs.

NavigateSelectClose
Loading Forge chat…