Skip to Content
Patternfly Logo

Card

A card is a flexible element for containing any kind of content. Cards are used on dashboards, in data displays (e.g. Card View), or for positioning content on a page.

ExamplesPropsCSS Variables

Examples

Basic

Header
Body

With image and actions

PatternFly logo
Header
Body

Card header in card head

This is a really really really really really really really really really really long header
Body

Only actions in card head (no header/footer)

This is the card body, there is only actions in the card head.

Only image in the card head

PatternFly logo
Header
Body

With no header

This card has no header

With only a content section

Body

With multiple body sections

Header
Body
Body
Body

With only one body that fills

Header
Body pf-m-no-fill
Body pf-m-no-fill
Body

Hover

Header
Body

Compact

Header
Body

Selectable and selected

First card
This is a selectable card. Click me to select me. Click again to deselect me.

Second card
This is a selectable card. Click me to select me. Click again to deselect me.

Flat

Header
Body

Props

Card properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Card
classNamestringNo''Additional classes added to the Card
componentunknownNo'article'Sets the base component to render. defaults to article
isHoverablebooleanNofalseModifies the card to include hover styles on :hover
isCompactbooleanNofalseModifies the card to include compact styling
isSelectablebooleanNofalseModifies the card to include selectable styling
isSelectedbooleanNofalseModifies the card to include selected styling
isFlatbooleanNofalseModifies the card to include flat styling
CardHeadMain properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Card Head Main
classNamestringNo''Additional classes added to the Card Head Main
CardHeader properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Card Footer
classNamestringNo''Additional classes added to the Header
CardBody properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Card Body
classNamestringNo''Additional classes added to the Card Body
componentunknownNo'div'Sets the base component to render. defaults to div
isFilledbooleanNotrueEnables the body Content to fill the height of the card
CardFooter properties
NameTypeRequiredDefaultDescription
childrenReact.ReactNodeNonullContent rendered inside the Card Footer
classNamestringNo''Additional classes added to the Footer
componentunknownNo'div'Sets the base component to render. defaults to div

CSS Variables

.pf-c-card--pf-c-card--BackgroundColor
#fff
.pf-c-card--pf-c-card--BoxShadow
0 0.0625rem 0.125rem 0 rgba(3, 3, 3, 0.12), 0 0 0.125rem 0 rgba(3, 3, 3, 0.06)
.pf-c-card--pf-c-card--m-hoverable--hover--BoxShadow
0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08)
.pf-c-card--pf-c-card--m-selectable--hover--BoxShadow
0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08)
.pf-c-card--pf-c-card--m-selectable--focus--BoxShadow
0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08)
.pf-c-card--pf-c-card--m-selectable--active--BoxShadow
0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08)
.pf-c-card--pf-c-card--m-selectable--m-selected--BoxShadow
0 0.5rem 1rem 0 rgba(3, 3, 3, 0.16), 0 0 0.375rem 0 rgba(3, 3, 3, 0.08)
.pf-c-card--pf-c-card--m-selectable--m-selected--before--Height
3px
.pf-c-card--pf-c-card--m-selectable--m-selected--before--BackgroundColor
#06c
.pf-c-card--pf-c-card--m-compact__body--FontSize
0.875rem
.pf-c-card--pf-c-card--m-compact__footer--FontSize
0.875rem
.pf-c-card--pf-c-card--m-compact--first-child--PaddingTop
1rem
.pf-c-card--pf-c-card--m-compact--child--PaddingRight
1rem
.pf-c-card--pf-c-card--m-compact--child--PaddingBottom
1rem
.pf-c-card--pf-c-card--m-compact--child--PaddingLeft
1rem
.pf-c-card--pf-c-card--m-compact__header--not--last-child--PaddingBottom
0.5rem
.pf-c-card--pf-c-card--m-flat--BorderWidth
1px
.pf-c-card--pf-c-card--m-flat--BorderColor
#d2d2d2
.pf-c-card--pf-c-card--first-child--PaddingTop
1.5rem
.pf-c-card--pf-c-card--child--PaddingRight
1.5rem
.pf-c-card--pf-c-card--child--PaddingBottom
1.5rem
.pf-c-card--pf-c-card--child--PaddingLeft
1.5rem
.pf-c-card--pf-c-card__header--not--last-child--PaddingBottom
1rem
.pf-c-card--pf-c-card__body--FontSize
1rem
.pf-c-card--pf-c-card__footer--FontSize
1rem
.pf-c-card--pf-c-card__actions--PaddingLeft
1rem
.pf-c-card--pf-c-card__actions--child--MarginLeft
0.5rem
.pf-c-card.pf-m-compact--pf-c-card__body--FontSize
0.875rem
.pf-c-card.pf-m-compact--pf-c-card__footer--FontSize
0.875rem
.pf-c-card.pf-m-compact--pf-c-card--first-child--PaddingTop
1rem
.pf-c-card.pf-m-compact--pf-c-card--child--PaddingRight
1rem
.pf-c-card.pf-m-compact--pf-c-card--child--PaddingBottom
1rem
.pf-c-card.pf-m-compact--pf-c-card--child--PaddingLeft
1rem
.pf-c-card.pf-m-compact--pf-c-card__header--not--last-child--PaddingBottom
0.5rem
.pf-c-card.pf-m-flat--pf-c-card--BoxShadow
none