Skip to main content Home About the Design SystemRoadmap OverviewDesignersDevelopers OverviewColorGridIconographyInteractionsSpacingTypography Overview Global colorBox shadowTypographyBorderOpacitySpaceLengthIconBreakpointsMedia queries All elements Accordion Alert Announcement Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Card Chip Code block Call to action Dialog Disclosure Footer Health index Icon Jump links Menu dropdown Navigation link Navigation (primary) Navigation (secondary) Navigation (vertical) Pagination PopoverPlanned Progress stepper Scheme toggle Site status Skeleton Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed OverviewColor PalettesCustomizingDevelopers All PatternsAccordionCall to ActionCardFilterFormLink with iconLogo wallSearch barSticky bannerSticky cardTabsTagTile All Personalization PatternsAnnouncement FundamentalsAccessibility toolsAssistive technologiesCI/CDContentContributorsDesignDevelopmentManual testingResourcesScreen readers Design/code status Release notes Get support

Card

OverviewStyleGuidelinesCodeDemos
ImportingUsagerh-cardImportingUsagerh-card

Importing

Add rh-card to your page with this import statement:

<script type="module">
  import '@rhds/elements/rh-card/rh-card.js';
</script>
Copy to Clipboard Wrap lines

To learn more about installing RHDS elements on your site using an import map read our getting started docs.

Usage

<rh-card>
  <h2 slot="header">Card</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Nullam eleifend elit sed est egestas, a sollicitudin mauris
    tincidunt. Pellentesque vel dapibus risus. Nullam aliquam
    felis orci, eget cursus mi lacinia quis. Vivamus at felis sem.</p>
  <rh-cta slot="footer"
          variant="primary"
          href="#">Call to action</rh-cta>
</rh-card>

<style>
  rh-card {
    & h2 {
      font-size: initial;
    }
  }
</style>

<script type="module">
  import '@rhds/elements/rh-cta/rh-cta.js';
  import '@rhds/elements/rh-card/rh-card.js';
</script>
Copy to Clipboard Wrap lines

rh-card

Cards are flexible surfaces used to group information in a small layout. They give small previews of information or provide secondary content in relation to the content it's near. Several cards can be used together to group related information.

Slots 4

Slot Name Summary Description
header

If this slot is used, we expect a heading level tag (h1, h2, h3, h4, h5, h6). An icon, svg, or use of the icon component are also valid in this region.

footer

Use this slot for anything that you want to be stuck to the base of the card.

image

Use this slot for the promo variant of the card. Images & CTA's are most often slotted here.

[default]

Any content that is not designated for the header or footer slot, will go to this slot.
Note: [default] unnamed slots do not have a slot="name" attribute.

Attributes 3

Attribute DOM Property Description Type Default
color-palette colorPalette

Sets color palette, which affects the element's styles as well as descendants' color theme. Overrides parent color context. Your theme will influence these colors so check there first if you are seeing inconsistencies. See CSS Custom Properties for default values

'light' | 'lighter' | 'lightest' | 'dark' | 'darker' | 'darkest'
unknown
variant variant

Change the style of the card to be a "Promo"

'promo'
unknown
full-width fullWidth

Change a promo with an image + body + footer to use the full-width style

boolean
false

Methods 0

None

Events 0

None

CSS Shadow Parts 5

Part Name Summary Description
header

The header for the card. Contains the header slot.

footer

The footer for the card. Contains the footer slot.

container

The container for the card. Contains the image, header, body, and footer.

image

The image for the promo variant for the card. Contains the image slot.

body

The body for the card. Contains the default slot.

CSS Custom Properties 5

CSS Property Description Default
--rh-card-header-background-on-light transparent
--rh-card-header-background-on-dark transparent
--rh-card-heading-font-weight

The font weight for headings in the header and body

var(--rh-font-weight-body-text-medium, 500)
--rh-card-heading-font-family

The font family for headings in the header and body

var(--rh-font-family-heading, RedHatDisplay, 'Red Hat Display', Helvetica, Arial, sans-serif)
--rh-card-heading-font-size

The font size for headings in the header and body

var(--rh-font-size-heading-md, 1.75rem)

Design Tokens 35

Token Description Copy
--rh-color-interactive-primary-default
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-hover
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-focus
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-active
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-visited-default
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-visited-hover
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-visited-focus
Full CSS Variable Permalink to this token
--rh-color-interactive-primary-visited-active
Full CSS Variable Permalink to this token
--rh-border-radius-default

Card's default border radius

3px border radius; Example: Card

Full CSS Variable Permalink to this token
--rh-font-family-body-text

Body text font family

Full CSS Variable Permalink to this token
--rh-line-height-body-text

Line height for body text

Full CSS Variable Permalink to this token
--rh-border-width-sm

1px border width; Example: Secondary CTA or Button

Full CSS Variable Permalink to this token
--rh-color-border-subtle

Computed from the color context. Intended to be read for theming purposes, rather than set in page css.

Full CSS Variable Permalink to this token
--rh-color-text-primary
Full CSS Variable Permalink to this token
--rh-color-surface
Full CSS Variable Permalink to this token
--rh-font-size-heading-xs

h6 heading font size

Full CSS Variable Permalink to this token
--rh-color-surface-lightest

Primary surface (light theme)

Full CSS Variable Permalink to this token
--rh-color-surface-darkest

Primary surface (dark theme)

Full CSS Variable Permalink to this token
--rh-color-surface-lighter

Tertiary surface (light theme)

Full CSS Variable Permalink to this token
--rh-color-surface-darker

Secondary surface (dark theme)

Full CSS Variable Permalink to this token
--rh-font-family-heading

Heading font family

Full CSS Variable Permalink to this token
--rh-font-size-body-text-xl

20px font size

Full CSS Variable Permalink to this token
--rh-font-weight-body-text-medium

Medium font weight

Full CSS Variable Permalink to this token
--rh-line-height-heading

Line height for headings

Full CSS Variable Permalink to this token
--rh-space-lg

16px spacer

Full CSS Variable Permalink to this token
--rh-font-size-body-text-md

16px font size

Full CSS Variable Permalink to this token
--rh-font-size-body-text-2xl

24px font size

Full CSS Variable Permalink to this token
--rh-font-size-heading-sm

h5 heading font size

Full CSS Variable Permalink to this token
--rh-space-3xl

48px spacer

Full CSS Variable Permalink to this token
--rh-space-xl

24px spacer

Full CSS Variable Permalink to this token
--rh-space-2xl

32px spacer

Full CSS Variable Permalink to this token
--rh-space-4xl

64px spacer

Full CSS Variable Permalink to this token
--rh-font-size-body-text-lg

18px font size

Full CSS Variable Permalink to this token
--rh-font-size-heading-md

h4 heading font size

Full CSS Variable Permalink to this token
--rh-space-7xl

128px spacer

Full CSS Variable Permalink to this token
© 2026 Red Hat Deploys by Netlify