Card

Groups related content and actions.

When to use

Use a card to group a self-contained summary, its heading and related actions, such as a project or product. Use an article when the content stands on its own, or a neutral wrapper when it belongs to the surrounding section.

Default

Website redesign

Project overview

Review the navigation, page templates and launch checklist.

HTML
<div class="card">
	<div class="card-body">
		<h3 class="card-title h5">Website redesign</h3>
		<p class="card-subtitle h6">Project overview</p>
		<p class="mb-0">Review the navigation, page templates and launch checklist.</p>
	</div>
</div>

Card header

Website redesign

Project overview

Review the navigation, page templates and launch checklist.

HTML
<div class="card">
	<div class="card-header">
		<h3 class="card-title h5">Website redesign</h3>
		<p class="card-subtitle h6">Project overview</p>
	</div>
	<div class="card-body">
		<p class="mb-0">Review the navigation, page templates and launch checklist.</p>
	</div>
</div>

Action

Use native links or buttons for actionable cards. Reserve .card-action for custom controls with equivalent keyboard behavior.

HTML
<a class="card hover-shadow" href="/details">
	<div class="card-body">View project details</div>
</a>

Accessibility and behavior

  • Give each card a clear heading in the page hierarchy. Use visible text to identify the content and its actions.
  • Use links for navigation and native buttons for commands. Avoid nesting a button or link inside an entire-card link.
  • Keep the source order meaningful when changing the responsive layout. Hover shadows supplement the native focus indicator.

CSS variables

Override these base defaults on the listed selector after the library styles. Variants and states may replace them; global tokens follow the active theme.

TokenDefaultPurposeScope / state
--card-header-paddingvar(--spacer-3) var(--spacer-3) 0 var(--spacer-3)Header spacing, in top/right/bottom/left order..card
--card-header-border-bottom-width0Divider thickness below the header..card
--card-header-border-bottom-colorvar(--card-border-color)Divider color below the header..card
--card-body-padding-top-after-headervar(--spacer-1)Body top padding when immediately preceded by a header..card
--card-body-paddingvar(--spacer-3)Body spacing..card
--card-bg-colorvar(--bg-surface)Background color..card
--card-border-widthvar(--border-width)Border thickness..card
--card-border-colorvar(--border-color)Border color..card
--card-border-radiusvar(--border-radius)Corner radius..card
--card-bg-hover-colorvar(--bg-surface-hover)Background of a linked, button or action card on hover..card
--card-title-spacer-yvar(--spacer-2)Bottom margin for titles and subtitles; the header sets 0.5rem..card
--card-subtitle-colorvar(--text-muted)Subtitle text color..card
--card-transition-durationvar(--transition-duration, 0.2s)Duration of visual state transitions..card
--card-transition-easingvar(--transition-easing)Timing curve for visual state transitions..card