Design System

Card reference ​

Every prop, slot, element and forwarded attribute on CCard. For what the component decides, see Overview. For how to place one, see Usage.

Imported as CCard from @proxy-frontend/components.

Props ​

NameTypeRequiredDefaultMeaning
paddedbooleanNofalseAdds p-4 to the body region. The header and footer regions are unaffected

Slots ​

NameRenderedWrapper classes
defaultUnconditionallyflex-1 min-h-0, plus p-4 when padded is set
headerWhen the slot is suppliedborder-b-4 border-surface-page h-12 flex items-center
footerWhen the slot is suppliedborder-t border-line-subtle

The header and footer wrappers are guarded by v-if, so an absent slot renders no element and no rule.

Events ​

NamePayload
NoneThe component declares no emits

A listener passed at the call site is forwarded as an attribute and fires from the root element.

Vocabulary ​

AxisAccepted
severityNot accepted
variantNot accepted
sizeNot accepted
widthNot accepted

The shared axes in components do not apply to this component. Sizing comes from the parent element.

DOM and ARIA ​

DepthElementAttributesClasses
1divdata-pc-name="card", data-pc-section="root"size-full flex flex-col shadow-md bg-surface-raised text-fg-strong, with the 0.25rem corner the preset writes
2divdata-pc-section="body"size-full
3divdata-pc-section="content"size-full
4divNonesize-full flex flex-col
5divNoneThe header, body and footer wrappers listed under Slots, in that order

The component sets inheritAttrs: false and name: "CCard". It writes no role and no aria-* of its own, so an aria-* attribute from the call site lands on the root at depth 1 and nothing is redirected inwards.

Forwarded attributes ​

ShapeExamplesResult
data-*data-testid, data-tour-stepReaches the root
aria-*aria-label, aria-describedbyReaches the root
on followed by a capital@click, @keydownReaches the root
id, name, formidReaches the root
class, styleclass="h-full"Removed, with nothing reported
title, tabindex, rolerole="region"Outside the allow-list, so removed with the rest

The filter is useForwardedAttrs, shared with the other components that refuse attributes. CCard passes no owns list, so nothing is held back from the root. Directives are not attributes and are not filtered, so v-tooltip on a CCard reaches the root.

Library sections ​

SectionPreset classClass after CCard applies its own
rootflex flex-col shadow-md bg-surface-raised text-fg-strong, with a 0.25rem cornerThe same, with size-full added
bodyflex flex-col gap-4 p-6size-full
contentp-0size-full
header, caption, title, subtitle, footerDefined in the presetNot rendered, because CCard passes only the content slot down

The pass-through merge spreads the component value over the preset value, so a section named by both keeps the component value alone.

Measurements ​

ValueWhereSource
48pxHeader band heighth-12 against --spacing: 4px
4pxStrip under the headerborder-b-4 border-surface-page
1pxRule above the footerborder-t border-line-subtle
16pxBody padding when padded is setp-4
0Body padding by defaultNo padding class on the body wrapper
3.5pxCorner at the 14px interface defaultThe 0.25rem corner the preset writes
4pxCorner measured against a 16px rootThe 0.25rem corner the preset writes
noneComputed box-shadow on a rendered cardshadow-md, with no shadow token defined to resolve it

The system radius of 6px is in space. The surface step behind the card is in depth.

ComponentDifference
CWellPaints surface-page rather than surface-raised, separates its regions with 1px line-subtle rules, and scrolls its own body
CDialogA raised surface that floats over the page, with its own widths and a close control

Tests ​

AssertionPinned value
The header carries the same strip as a table headerborder-bottom-width of 4px, and a colour matching border-b-4 border-surface-page
The header height48px
The footer ruleborder-top-width of 1px