Skip to main content Red Hat Design System logo Contribute on Github v1.4.5

Card

Overview Style Guidelines Demos Code

Installation

rh-card

Slots 4
Slot Name 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.

image

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

Any

content that is not designated for the header or footer slot, will go to this slot.

footer

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

Attributes 3
DOM Property Description Type Default
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

Card always resets its context to base, unless explicitly provided with a color-palette.

'darkest' | 'lightest' | 'lighter' | undefined
unknown
variant

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

'promo' | undefined
unknown
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 Description
container

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

header

The header for the card. Contains the header slot.

image

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

body

The body for the card. Contains the default slot.

footer

The footer for the card. Contains the footer slot.

CSS Custom Properties 3
CSS Property Description Default
--rh-card-heading-font-family

The font family for headings in the header and body

--rh-font-family-heading
--rh-card-heading-font-size

The font size for headings in the header and body

--rh-font-size-heading-sm
--rh-card-heading-font-weight

The font weight for headings in the header and body

--rh-font-weight-body-text-medium
Design Tokens 0

None

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