HTML
Card
ExamplesDocumentationCSS VariablesExamples
With header in head
This is a really really really really really really really really really really long header
Body
Documentation
Overiew
A card is a generic rectangular container that can be used to build other components. Use a default card for regular page content and the compact variation for dashboard or small cards.
Accessibility
Attribute | Applied to | Outcome |
---|---|---|
tabindex="0" | .pf-c-card.pf-m-selectable | Inserts the selectable card into the tab order of the page so that it is focusable. Required |
Usage
Class | Applied | Outcome |
---|---|---|
.pf-c-card | <div> | Creates a card containing content. Required |
.pf-c-card__header | <div> | Creates the header of a card. |
.pf-c-card__body | <div> | Creates the body of a card. By default, the body element fills the available space in the card. You can use multiple .pf-c-card__body elements. |
.pf-c-card__footer | <div> | Creates the footer of a card. |
.pf-c-card__head | <div> | Creates the head of the card where images or actions can go. |
.pf-c-card__actions | <div> | Creates an actions element to be used in the card head. |
.pf-m-compact | .pf-c-card | Creates a compact variation of the card component that involves smaller font sizes and spacing. |
.pf-m-no-fill | .pf-c-card__body | Sets a .pf-c-card__body to not fill the available space in .pf-c-card . .pf-m-no-fill can be added to multiple card bodies. |
.pf-m-hoverable | .pf-c-card | Modifies the card to include hover styles on :hover . |
.pf-m-selectable | .pf-c-card | Modifies a selectable card so that it is selectable. |
.pf-m-selected | .pf-c-card.pf-m-selectable | Modifies a selectable card for the selected state. |
CSS Variables
--pf-c-card__actions--child--MarginLeft | c_card__actions_child_MarginLeft | 0.5rem |
--pf-c-card__actions--PaddingLeft | c_card__actions_PaddingLeft | 1rem |
--pf-c-card__body--FontSize | c_card__body_FontSize | 0.875rem |
--pf-c-card__footer--FontSize | c_card__footer_FontSize | 0.875rem |
--pf-c-card__header--not-last-child--PaddingBottom | c_card__header_not_last_child_PaddingBottom | 0.5rem |
--pf-c-card--BackgroundColor | c_card_BackgroundColor | #fff |
--pf-c-card--BoxShadow | c_card_BoxShadow | 0 0.0625rem 0.125rem 0 rgba(3,3,3,0.2) |
--pf-c-card--child--PaddingBottom | c_card_child_PaddingBottom | 1rem |
--pf-c-card--child--PaddingLeft | c_card_child_PaddingLeft | 1rem |
--pf-c-card--child--PaddingRight | c_card_child_PaddingRight | 1rem |
--pf-c-card--first-child--PaddingTop | c_card_first_child_PaddingTop | 1rem |
--pf-c-card--m-compact__body--FontSize | c_card_m_compact__body_FontSize | 0.875rem |
--pf-c-card--m-compact__footer--FontSize | c_card_m_compact__footer_FontSize | 0.875rem |
--pf-c-card--m-compact__header--not-last-child--PaddingBottom | c_card_m_compact__header_not_last_child_PaddingBottom | 0.5rem |
--pf-c-card--m-compact--child--PaddingBottom | c_card_m_compact_child_PaddingBottom | 1rem |
--pf-c-card--m-compact--child--PaddingLeft | c_card_m_compact_child_PaddingLeft | 1rem |
--pf-c-card--m-compact--child--PaddingRight | c_card_m_compact_child_PaddingRight | 1rem |
--pf-c-card--m-compact--first-child--PaddingTop | c_card_m_compact_first_child_PaddingTop | 1rem |
--pf-c-card--m-hoverable--hover--BoxShadow | c_card_m_hoverable_hover_BoxShadow | 0 0.1875rem 0.4375rem 0.1875rem rgba(3,3,3,0.13),0 0.6875rem 1.5rem 1rem rgba(3,3,3,0.12) |