Cards - National Design System

A composable container for grouping content, metrics, or actions with stroke, shadow, color-fill, and on-color treatments for any surface

Standard

Build product, article, or service cards by combining header, content, tags, rating, and action sub-components

Card Title

Short description of this card content goes here for demonstration.

Category Topic Active

Statistic

A centered metric layout for headline numbers in dashboards and stats grids

0

Active Users

Card Group

Pair cards with nds-grid for responsive column-shifting layouts

0

Active Users

0

Completed

0

Success Rate

0

Pending

Built-in Features

What you get out of the box with zero configuration

Composable Anatomy

Mix header, content, tags, rating, checkbox, status, and actions to build product, article, service, or user cards.

Seven Color Variants

Default, gold, neutral, lavender, yellow, red, and blue treatments adjust title, border, and icon tints together. Combine with nds-color for a tinted fill.

Statistic Mode

Centered metric layout with display-sized numbers and an icon for dashboards and stats grids.

Image with Overlay

Aspect ratio, focal point, and gradient overlay are tunable per card through CSS variables on the image container.

On-Color Treatment

Add nds-oncolor to adapt text, borders, and icon tints for dark sections, hero backgrounds, or photographic surfaces.

Interactive States

Use the card as <a> or <button> to get hover and active feedback on stroke and shadow variants.

CSS-Driven Theming

Override padding, gap, radius, colors, and width per instance via --card-* custom properties.

Responsive Layout

Card actions stack on mobile. Pair with nds-grid for column-shifting card groups.

Usage Guidelines

When and how to use cards effectively

Best Practices

  • Use cards to group related content into scannable units: service tiles, product listings, article previews, and dashboard widgets
  • Use nds-statistic for headline metrics in dashboards: a single number, a label, and an optional icon. Pair multiple statistic cards inside a grid for KPI rows
  • Choose nds-stroke for flat or content-heavy layouts. Use nds-shadow for elevated, floating, or modal-adjacent cards
  • Use nds-color together with a color variant (nds-blue, nds-yellow, etc.) to category-code or status-code groups of cards in dashboards
  • Use nds-oncolor when placing cards on dark sections, hero backgrounds, or imagery so text and borders stay readable
  • Make the entire card clickable by using <a> or <button> as the root element, not by wrapping a card in a separate link
  • Don't use a card for a transient status message: use an Alert instead. Don't use a card to block the user for a decision: use a Modal
  • Don't nest cards inside cards. If you need internal structure, use nds-card-meta, nds-card-tags, or a definition list inside the content area
  • Add a featured icon or avatar in the header for quick visual recognition. Size up (nds-lg, nds-xl) on statistic cards and grid contexts where the icon carries the meaning
  • Keep card descriptions to one or two lines. For longer copy, add nds-truncate on the title and description, or link out to a detail page from the actions area

Modifier Classes

ClassDescription
nds-strokeAdds a 1px outline border around the card
nds-shadowAdds an elevation shadow; deepens on hover when the card is interactive
nds-colorTinted background fill that matches the active color variant
nds-rowViewSwitches the card to a horizontal row layout (header sits to the side)
nds-centerCenters header, content, tags, rating, and actions horizontally
nds-statisticCentered metric layout with a large display number; size with nds-md or nds-sm on the number element
nds-userCompact user-card preset with a 224px default width
nds-full-width / nds-fullRemoves the max-width cap so the card fills its container
nds-oncolorAdapts text, borders, and icon tints for dark or photographic surfaces
nds-gold, nds-neutral, nds-lavendar, nds-yellow, nds-red, nds-blueColor variants that retint title, border-hover, and icon. Combine with nds-color for a matching tinted fill
nds-disabled / [disabled]Mutes colors, dims sub-content, and removes pointer interactions

CSS Custom Properties

PropertyDefaultDescription
--card-bg--background-cardCard background color
--card-bg-hover--background-card-hoveredBackground when the card is interactive and hovered
--card-border--border-neutral-primaryStroke color for the nds-stroke variant
--card-border-hover--border-primaryStroke color when the card is hovered
--card-border-active--border-neutral-primaryStroke color when the card is pressed
--card-padding--spacing-xlInner padding of the card
--card-gap--spacing-3xlVertical gap between header, content, meta, and actions
--card-radius--components-card-radiusCorner radius
--card-width100%Card width inside its container
--card-width-min0Minimum width
--card-width-max360pxMaximum width cap
--card-title--text-displayTitle color
--card-subtitle--text-primarySubtitle color
--card-text--text-displayDescription and body text color
--card-number--text-primary-sa-flagStatistic number color
--card-rating--text-secondary-paragraphRating helper text color
--icon-color--featuredicons-icon-primaryFeatured-icon color (also drives the avatar color)
--icon-bg-color--featuredicons-background-brand-lightFeatured-icon background color
--img-ratio2 / 1Set on .nds-card-image to control aspect ratio
--img-pos-x50%Horizontal focal point of the image
--img-pos-y50%Vertical focal point of the image
--overlay0Opacity of the dark gradient overlay on the image (0 to 1)
Was this page useful?
60% of users said Yes from 2843 Feedbacks