Card
A card groups content about one subject, such as a recipe with its notes, on a single surface. Its variant sets how firmly the card stands apart from the page behind it, and a built-in badge flags news with no extra element to place. The cards below share one bake; watch two badges come and go.
Reference docs
Choosing a card
Two components share the card's surface. Each suits a different job:
- Card: a container grouping content about one subject, with its own buttons if it needs them, such as a recipe summary.
- Action card: a whole card that is one click target, opening or doing one thing, such as a product tile.
Two jobs belong elsewhere. A single action is a button, and items in a column are a list.
Choosing a variant
Three variants set how much a card stands out from its surface, from most to least:
- Elevated: lifts a card off a patterned or same-colored surface, such as a card over a photo.
- Filled: a quiet separation between the card and the page, such as a group of settings.
- Outlined: the least emphasis, for a set of equal cards, such as a list of recipes.
Built in
- A badge shows a count or a dot on the card, with no extra element to place:
,badge-value , andbadge-dot .badge-concealed keeps a full-bleed image inside a rounded or shaped card.mask-content- The
falls back to your style configuration, so one setting restyles every card that sets none.variant
Using cards well
- Use one variant for every card in a group, so the group reads as a set.
- Keep each card to one subject: an image, a headline, supporting text, then the actions.
- Put the actions of a card with several in separate buttons inside it. When the whole card is the one action, use an Action card instead.
- Let the container set a card's width, whether a grid cell or a column, rather than the content.
These rules follow Material 3 Expressive's guidance for cards, on material.io.
Variants
A card takes one of three variants. Omit variantoutlined
Badges
badge-valuebadge-dotbadge-concealed
Clipped content
Content in the default slot is clipped to the card's box. Turn on mask-content
Actions
Place one button per action after the content it acts on. The card takes no pointer action itself, so each button keeps its own focus and label.
Properties
| Property | Attribute | Type | Description |
|---|---|---|---|
badgeConcealed | badge-concealed | booleandefault false | Hides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges. |
badgeDot | badge-dot | booleandefault false | Shows the badge as a small dot with no text, whether or not badgeValue is set. See Badges. |
badgeValue | badge-value | string | The badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges. |
maskContent | mask-content | boolean | Clips the content to the component's shape, so anything that extends past a rounded corner is cut off. See Clipped content. |
variant | variantelevated, filled, outlined | CardVariantCardVariant.Elevated, .Filled, .Outlineddefault CardVariant.Outlined, from the style configuration | Sets whether the card is raised with a shadow, filled with a solid color, or flat with an outline. See Variants. |
Slots
| Slot | Description |
|---|---|
| (default) | The card's content. |
Props
| Prop | Type | Description |
|---|---|---|
badgeConcealed | booleandefault false | Hides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges. |
badgeDot | booleandefault false | Shows the badge as a small dot with no text, whether or not badgeValue is set. See Badges. |
badgeValue | string | The badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges. |
maskContent | boolean | Clips the content to the component's shape, so anything that extends past a rounded corner is cut off. See Clipped content. |
variant | CardVariantTypeCardVariant.Elevated, .Filled, .Outlineddefault CardVariant.Outlined, from the style configuration | Sets whether the card is raised with a shadow, filled with a solid color, or flat with an outline. See Variants. |
Children
| Child | Description |
|---|---|
children | The card's content. |
Parameters
| Parameter | Type | Description |
|---|---|---|
BadgeConcealed | bool?default false | Hides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges. |
BadgeDot | bool?default false | Shows the badge as a small dot with no text, whether or not BadgeValue is set. See Badges. |
BadgeValue | string? | The badge's text. While it is empty and BadgeDot is not set, no badge renders. Ignored if BadgeDot is set. See Badges. |
MaskContent | bool? | Clips the content to the component's shape, so anything that extends past a rounded corner is cut off. See Clipped content. |
Variant | CardVariant?CardVariant.Elevated, .Filled, .Outlineddefault CardVariant.Outlined, from the style configuration | Sets whether the card is raised with a shadow, filled with a solid color, or flat with an outline. See Variants. |
Render fragments
| Parameter | Type | Description |
|---|---|---|
ChildContent | RenderFragment? | The card's content. |
Inputs
| Input | Type | Description |
|---|---|---|
badgeConcealed | booleandefault false | Hides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges. |
badgeDot | booleandefault false | Shows the badge as a small dot with no text, whether or not badgeValue is set. See Badges. |
badgeValue | string | The badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges. |
maskContent | boolean | Clips the content to the component's shape, so anything that extends past a rounded corner is cut off. See Clipped content. |
variant | CardVariantTypeCardVariant.Elevated, .Filled, .Outlineddefault CardVariant.Outlined, from the style configuration | Sets whether the card is raised with a shadow, filled with a solid color, or flat with an outline. See Variants. |
Content projection
| Content | Description |
|---|---|
content with no slot | The card's content. |
Props
| Prop | Type | Description |
|---|---|---|
badgeConcealed | booleandefault false | Hides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges. |
badgeDot | booleandefault false | Shows the badge as a small dot with no text, whether or not badgeValue is set. See Badges. |
badgeValue | string | The badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges. |
maskContent | boolean | Clips the content to the component's shape, so anything that extends past a rounded corner is cut off. See Clipped content. |
variant | CardVariantTypeCardVariant.Elevated, .Filled, .Outlineddefault CardVariant.Outlined, from the style configuration | Sets whether the card is raised with a shadow, filled with a solid color, or flat with an outline. See Variants. |
Slots
| Slot | Description |
|---|---|
default | The card's content. |
Props
| Prop | Type | Description |
|---|---|---|
badgeConcealed | booleandefault false | Hides the badge while keeping its value and dot setting, so clearing this property shows the same badge again. See Badges. |
badgeDot | booleandefault false | Shows the badge as a small dot with no text, whether or not badgeValue is set. See Badges. |
badgeValue | string | The badge's text. While it is empty and badgeDot is not set, no badge renders. Ignored if badgeDot is set. See Badges. |
maskContent | boolean | Clips the content to the component's shape, so anything that extends past a rounded corner is cut off. See Clipped content. |
variant | CardVariantTypeCardVariant.Elevated, .Filled, .Outlineddefault CardVariant.Outlined, from the style configuration | Sets whether the card is raised with a shadow, filled with a solid color, or flat with an outline. See Variants. |
Snippets
| Snippet | Description |
|---|---|
children | The card's content. |
Each attribute value has its own tokens; a cell shows its token's value, and selecting the cell shows the token's fallback path, with each name and value ready to copy. For example, the outlined column's container-shadow-color row is --ct-card-outlined-container-shadow-color, which defaults to --ct-sys-color-shadow.
Variant
| Name | elevated | filled | outlined |
|---|---|---|---|
container-color | same as --ct-card-container-color --ct-card-elevated-container-color | same as --ct-card-container-color --ct-card-filled-container-color | same as --ct-card-container-color --ct-card-outlined-container-color |
container-elevation | same as --ct-card-container-elevation --ct-card-elevated-container-elevation | same as --ct-card-container-elevation --ct-card-filled-container-elevation | same as --ct-card-container-elevation --ct-card-outlined-container-elevation |
container-shadow-color | --ct-sys-color-shadow --ct-card-elevated-container-shadow-color | --ct-sys-color-shadow --ct-card-filled-container-shadow-color | --ct-sys-color-shadow --ct-card-outlined-container-shadow-color |
outline-color | transparent --ct-card-elevated-outline-color | transparent --ct-card-filled-outline-color | --ct-sys-color-outline-variant --ct-card-outlined-outline-color |
outline-opacity | 1 --ct-card-elevated-outline-opacity | 1 --ct-card-filled-outline-opacity | 1 --ct-card-outlined-outline-opacity |
outline-width | 0px --ct-card-elevated-outline-width | 0px --ct-card-filled-outline-width | 1px --ct-card-outlined-outline-width |
hover-container-elevation | --ct-sys-elevation-level2 --ct-card-elevated-hover-container-elevation | --ct-sys-elevation-level1 --ct-card-filled-hover-container-elevation | --ct-sys-elevation-level0 --ct-card-outlined-hover-container-elevation |
hover-state-layer-color | --ct-sys-color-on-surface-variant --ct-card-elevated-hover-state-layer-color | --ct-sys-color-on-surface-variant --ct-card-filled-hover-state-layer-color | --ct-sys-color-on-surface-variant --ct-card-outlined-hover-state-layer-color |
hover-state-layer-opacity | --ct-sys-state-hover-state-layer-opacity --ct-card-elevated-hover-state-layer-opacity | --ct-sys-state-hover-state-layer-opacity --ct-card-filled-hover-state-layer-opacity | --ct-sys-state-hover-state-layer-opacity --ct-card-outlined-hover-state-layer-opacity |
focus-container-elevation | --ct-sys-elevation-level1 --ct-card-elevated-focus-container-elevation | --ct-sys-elevation-level0 --ct-card-filled-focus-container-elevation | --ct-sys-elevation-level0 --ct-card-outlined-focus-container-elevation |
pressed-container-elevation | --ct-sys-elevation-level1 --ct-card-elevated-pressed-container-elevation | --ct-sys-elevation-level0 --ct-card-filled-pressed-container-elevation | --ct-sys-elevation-level0 --ct-card-outlined-pressed-container-elevation |
pressed-state-layer-color | --ct-sys-color-on-surface-variant --ct-card-elevated-pressed-state-layer-color | --ct-sys-color-on-surface-variant --ct-card-filled-pressed-state-layer-color | --ct-sys-color-on-surface-variant --ct-card-outlined-pressed-state-layer-color |
pressed-state-layer-opacity | --ct-sys-state-pressed-state-layer-opacity --ct-card-elevated-pressed-state-layer-opacity | --ct-sys-state-pressed-state-layer-opacity --ct-card-filled-pressed-state-layer-opacity | --ct-sys-state-pressed-state-layer-opacity --ct-card-outlined-pressed-state-layer-opacity |
Other tokens
| Token | Value |
|---|---|
--ct-card-container-color | --ct-sys-color-surface-container-low --ct-card-container-color |
--ct-card-container-elevation | --ct-sys-elevation-level1 --ct-card-container-elevation |
Names and states
A card has no role and takes no focus, so assistive technology does not announce it as a card; the WAI-ARIA Authoring Practices Guide has no pattern for one.
- A card has no accessible name of its own. Give the content a heading, or place the card in a landmark or list item that your page names.
aria-label,aria-labelledby, androleon a card are removed from it and have no effect. No otheraria-*attribute you add takes effect either.- Say in the content what a badge means, in text. A count or a dot alone does not tell a user what it counts.
- A card has no tooltip of its own. A plain tooltip anchored on it describes nothing, since the card takes no focus.
- For a whole card that is one control, use an Action card, which is announced as a button or a link.
Keyboard and focus
| Key | Action |
|---|---|
| Tab | Moves past the card; the card is not a tab stop |
- A card handles no keys. Controls you place inside take Tab and their own keys, as they do anywhere on the page.
- A card draws no focus ring, because it has nothing to focus.
Pointer and touch
- A plain card has no touch target, because it takes no pointer action. An Action card carries one at least 48 by 48 pixels, which meets WCAG 2.5.8.
- Give each control inside a card a target of at least 24 by 24 pixels.
Display settings
- In forced-colors mode the card paints its surface in the system
Canvascolor and gives slotted content full opacity.
Standards
With its defaults, the card meets zero WCAG 2.2 success criteria, because it has no role, name, or control of its own. Three more depend on how you use it:
- 1.3.1 Info and Relationships (A) — mark up the content inside as headings, lists, and paragraphs, so its structure is not only visual.
- 2.4.7 Focus Visible (AA) — a card takes no focus, so every control you place in it must show a visible focus indicator.
- 2.5.8 Target Size (Minimum) (AA) — keep every control inside a card at least 24 by 24 pixels.