Card

A card component that provides a container for content with optional header and footer sections. It supports separators between sections and customizable padding.

Source

Props

NameDefaultType
separatorsfalseboolean
Adds separators between all sections (header, content, footer)
headerSeparatorfalseboolean
Adds a separator only after the header section
footerSeparatorfalseboolean
Adds a separator only before the footer section
paddingtrueboolean
Controls whether the card content has padding
headerAlignbaseline'start' | 'center' | 'end' | 'baseline'
Controls vertical alignment of items in the card header

Slots

NameAcceptsDescription
defaultanyThe main content of the card
headeranyContent to be displayed in the header section
header-endanyContent to be displayed at the end of the header section (right-aligned)
footeranyContent to be displayed in the footer section

Centered Header

Use the header-align prop to vertically align header content. This is useful when the header contains more than just the card title.

Error State

Use centered and border-style="dashed" to create a styled error state card.

Something went wrong

We couldn't process your request. Please try again later.

Tokens

CSS variable tokens used for global or per-instance manipulation of certain styling.

TokenDefaultDescription
--vui-card-header-aligncenterHeader content alignment
--vui-card-border-stylesolidBorder style
--vui-card-border-colorvar(--color-border)Border color
--vui-card-background-colorvar(--color-bg)Background color
--vui-card-padding-blockvar(--space-m)Vertical content padding
--vui-card-padding-inlinevar(--space-m)Horizontal content padding