Skip to main content Red Hat Design System logo Contribute on Github v2.0.0 Home
About About the design systemHow we buildRoadmap
Get started OverviewDesignersDevelopers
Foundations OverviewColorGridPersonalization patternsSpacingTypography
Tokens Overview Global colorBox shadowTypographyBorderOpacitySpaceLengthIconBreakpointsMedia queries
Elements All elements Accordion Alert Audio player Avatar Back to top Badge Blockquote Breadcrumb Button Call to action Card Code block Dialog Footer Health index Icon Navigation (primary)Planned Navigation (secondary) Pagination PopoverPlanned Progress stepsPlanned Site status Skip link Spinner Statistic Subnavigation Surface Switch Table Tabs Tag Tile Timestamp Tooltip Video embed
Patterns All patternsAnnouncementCardDisclosureFilterFormLinkLink with iconLogo wallSearch barSkip navigationSticky bannerSticky cardTabsTileVideo thumbnail
Accessibility FundamentalsContentDesignDevelopmentContributorsQa and testingAssistive technologiesResources
Design/code status Release notes Get support

Card

Overview Guidelines Examples
  1. Overview
  2. Customizing cards
  3. Themes
  1. Overview
  2. Customizing cards
  3. Themes

Overview

A card formats content in a small, contained space. It can be used to display a preview of information or provide secondary content in relation to the content it's near. Several cards can be used together to group related information.

These Card patterns document different design-approved uses of the <rh-card> element. Consult the <rh-card> element documentation for more information on how to use the card element.

Customizing cards

To customize a card the design tokens must be altered. These design tokens are different depending on the context for the card (light or dark theme).

Examples include:

For more information, please see the card css custom properties.

Themes

Themes are expressed in terms of color palettes.

  • lightest
  • lighter
  • light
  • dark
  • darker
  • darkest

Context theming

Cards will automatically react to the color-palette context provided by a parent element, like <rh-surface>.

Light theme

Card title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.

Call to action
Copy to Clipboard

Dark theme

Card title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.

Call to action
Copy to Clipboard

Explicit card theming

Cards can play an active role in theming by declaring a specific color-palette.

Lighter themed card

Card title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.

Call to action
Copy to Clipboard

Custom theming

When using design tokens to apply custom themes, it is important to ensure that the colors used meet color contrast guidelines.

Card title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vitae elit libero, a pharetra augue. Nullam id dolor id nibh ultricies vehicula ut id elit. Donec id elit non mi porta gravida at eget metus.

Call to action
Copy to Clipboard

Other libraries

To learn more about our other libraries, visit the getting started page.

© 2021-2024 Red Hat, Inc. Deploys by Netlify