Examples
Basic
Title, body, and footer — the minimal card.
Project Apollo
Card with subtitle
A pf-v6-c-card__subtitle below the title.
Card title
pf-v6-c-card__subtitle element below the title.Card with subtitle and actions
Header actions (kebab + checkbox) with a title and subtitle in the header main area.
Card title
Secondary cards
pf-m-secondary — secondary background variant.
First card
pf-m-secondary uses the secondary background color variant.Second card
Third card
Compact
pf-m-compact — tighter padding for dense grids.
Compact card
Flat
Kept for back-compat — PF v6 cards are flat by default; the
flat param is accepted but emits no class.
Flat card
Modifiers
Toggle pf-m-compact / pf-m-display-lg /
pf-m-full-height / pf-m-plain live.
Modifier playground
pf-m-* classes live.Header images and actions
Brand image in the header with end-aligned actions.
Card title
Title inline with images and actions
Image and title share the header main area.
This title sits in the card head
Card header without title
A header that carries only actions.
Card with header that wraps
pf-m-wrap lets long titles wrap under the actions.
This is a really really really really really really really really really really long header
pf-m-wrap on the header lets a long title wrap under the actions.With HTML heading element
The title text takes whatever heading level fits the page outline.
This title is an <h4>
With multiple body sections
Cards can stack several __body elements.
Card title
With a primary body section that fills
Bodies default to filling; pf-m-no-fill opts out per section.
Card title
pf-m-no-fillSelectable
pf-m-selectable + a checkbox in __selectable-actions; Alpine
flips pf-m-selected. Third card is disabled.
First card
Second card
Third card
Single selectable
Radio-backed selection — exactly one card holds pf-m-selected.
First card
Second card
Third card
Actionable
pf-m-clickable with an invisible __clickable-action overlay
— button, link, and disabled variants.
Actionable and selectable
Checkbox selection combined with a clickable title.
Expandable cards
__header-toggle + __expandable-content; the toggle icon
rotates via pf-m-expanded.
Expandable card
Card with dividers
pf-v6-c-divider rules between the card sections.
Card title
Single selectable tiles
Tile-style selectable cards backed by radios.
Tile one
Tile two
Tile three
Multi selectable tiles
Tile-style selectable cards backed by checkboxes.
Tile one
Tile two
Tile three
Documentation
Card props
The card is a template family: card is the root and the sections are their own includes
— card-header, card-title,
card-subtitle, card-body,
card-footer, card-expandable-content — composed inside the
card include's main block. Section content is each include's own main block (rich markup welcome), so no
generic slot names exist to collide with outer templates; card-header's named slots
are card-prefixed (cardActions, cardSelectableActions,
cardHeaderMain) for the same reason.
| Name | Type | Description |
|---|---|---|
id
|
String | DOM id on the card root. |
compact / displayLg / plain / fullHeight / secondary
|
Boolean |
The matching pf-m-* modifier.
|
selectable / clickable / selected / disabled
|
Boolean |
Selection-related modifiers; pair with card-header hasSelectableActions.
|
expandable
|
Boolean |
Wires the expand contract: Alpine expanded state on the root + bound
pf-m-expanded. Pair with
card-header expandable=true and
card-expandable-content.
|
selectedExpr
|
String |
Alpine expression; while truthy the card carries pf-m-selected. E.g.
selectedExpr="chosen === 'one'".
|
attrs
|
String (raw) | Raw attribute passthrough on the root for Alpine directives. Shadowed inside the family's slots so it cannot leak into composed includes. |
card-header
|
Include |
wrap, expandable,
toggleAriaLabel; guarded slots cardActions /
cardSelectableActions / cardHeaderMain via
has* params; main block renders bare (direct title spot).
|
card-title
|
Include |
headingLevel (default h2), id for
aria-labelledby wiring; title content is the main block — links, icons, buttons
all fine.
|
card-subtitle / card-body / card-footer
|
Include |
Main-block content; card-body takes noFill and
can repeat for multiple sections.
|
card-expandable-content
|
Include |
The region the toggle reveals (x-show="expanded"); put body/footer includes
inside.
|
Usage
Pair with Gallery. The canonical card grid is Gallery layout + cards as children — auto-fill, equal width, gutters.
Clickable cards. For full-card click targets, wrap the card in an <a> or attach
role="button" tabindex="0" + click handler. Ensure focus styles are visible.