Skip to content
Kimenpre-v1documentation home
Color scheme

ki-card

Group related media, a heading, supporting text and actions on one surface. Fill any subset of the regions.

Theme for this example
Color scheme for this example

Weekly report

Traffic is up 12% week over week; conversion held steady. View details
<ki-card>
<h3 slot="header">Weekly report</h3>
Traffic is up 12% week over week; conversion held steady.
<ki-button slot="footer" variant="secondary" type="button">View details</ki-button>
</ki-card>

media, header, the default body and footer are independent slots:

Theme for this example
Color scheme for this example

Just the header and body

Cards render only the regions you fill; empty regions collapse.
<ki-card>
<h3 slot="header">Just the header and body</h3>
Cards render only the regions you fill; empty regions collapse.
</ki-card>

Place separate controls in the body or footer.

Theme for this example
Color scheme for this example
Ready to publish this draft? Publish Discard
<ki-card>
Ready to publish this draft?
<ki-button slot="footer" variant="primary" type="button">Publish</ki-button>
<ki-button slot="footer" variant="ghost" type="button">Discard</ki-button>
</ki-card>

default uses the theme’s card. Use elevated for a raised surface, filled for a tint or outlined for a visible border.

Theme for this example
Color scheme for this example

Elevated

A raised surface.

Filled

A tinted surface.

Outlined

A bordered surface.
<ki-card variant="elevated"><h3 slot="header">Elevated</h3>A raised surface.</ki-card>
<ki-card variant="filled"><h3 slot="header">Filled</h3>A tinted surface.</ki-card>
<ki-card variant="outlined"><h3 slot="header">Outlined</h3>A bordered surface.</ki-card>

Set href to link to another view. Set interactive for a button that emits ki-activate once. Each needs a single text heading in the header slot. When both options are present, the card follows href.

Theme for this example
Color scheme for this example

Search index rebuild

Scheduled for midnight.

Bookmark

Preview monthly report

Review the new report before publishing it.

<ki-card variant="outlined" href="#examples">
<h3 slot="header">Search index rebuild</h3>
<p>Scheduled for midnight.</p>
<ki-button slot="footer" variant="secondary" type="button">Bookmark</ki-button>
</ki-card>
<ki-card interactive variant="filled">
<h3 slot="header">Preview monthly report</h3>
<p>Review the new report before publishing it.</p>
</ki-card>

When to use: group related media, a title, supporting text and actions into one scannable surface. Set href for navigation or interactive for a declared action. Give a clickable card one text heading in the header slot and place secondary controls in the body or footer.

When not to use: as a form field, fieldset, page landmark, section replacement or nested card. Use a standalone button or link for a control without supporting content.

Properties & attributes

AttributePropertyTypeDefaultDescription
hrefhrefstring | undefined–Destination for the card's title link. Supply a text heading in the header slot. A nonblank href takes precedence over interactive.
interactiveinteractiveboolean | undefinedfalseGives a titled card a primary button that emits ki-activate. Use href for navigation. Keep other actions in separate controls in the card.
variantvariant"default" | "elevated" | "filled" | "outlined" | undefined'default'Surface treatment. Choose elevated for a raised panel, filled for a tinted group or outlined for a bordered surface. Use default to follow the theme's existing card treatment.

Events

EventDetail typeDescription
ki-activateCustomEvent<void>Fires once when the user activates an action card by pointer or keyboard.

Slots

SlotDescription
(default)Body region for supporting text or arbitrary composed content.
footerClosing region for actions such as ki-button; no dedicated actions slot exists in v1.
headerTitle region. Supply one nonempty text heading at the surrounding document level for a clickable card.
mediaLeading visual region for an image, video or illustration.

CSS parts

PartDescription
bodyBody region wrapper around the default slot.
cardCard surface: background, border, radius, elevation and region gap.
footerFooter region wrapper.
headerHeader region wrapper.
mediaMedia region wrapper.
triggerNative link or action button in a clickable card’s heading.

CSS custom properties

The public styling contract of ki-card: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-card-backdrop-filterComplete card backdrop filter, off by default.
--ki-card-bgcolor used by the card component for background (MarsUI Dashboard masters bind Surface/special/light-s0_dark-s1: white light / Dark/900 dark; #f9f9fa is the nested media panel, so the old s1 value inverted the surface hierarchy).
--ki-card-bg-imageOptional decorative image over the card background.
--ki-card-body-paddingdimension used by the card component for body padding.
--ki-card-border-colorcolor used by the card component for border color (MarsUI Outline/base_em hairline — painted on large Chart cards; Dashboard_info leaves width 0, which stays the default via ki.card.border-width).
--ki-card-border-widthdimension used by the card component for border width.
--ki-card-elevated-bgRaised card background.
--ki-card-elevated-fgText on the elevated card background.
--ki-card-elevated-shadowResting shadow for an elevated card.
--ki-card-elevationCard resting elevation: MarsUI elevation ramp level e1 (brief §5, drop 0/1/1/-0.5 in the scheme shadow color; replaces the migrated M2-era shadow).
--ki-card-fgcolor used by the card component for foreground.
--ki-card-filled-bgTinted card background.
--ki-card-filled-fgText on the filled card background.
--ki-card-footer-paddingdimension used by the card component for footer padding.
--ki-card-gapdimension used by the card component for gap (MarsUI Dashboard_info/Chart inter-region rhythm 12px; material3 keeps zero via its override).
--ki-card-header-paddingdimension used by the card component for header padding.
--ki-card-hover-overlayPointer hover state layer on a primary-action card.
--ki-card-hover-shadowHover shadow of a primary-action card.
--ki-card-media-paddingdimension used by the card component for media padding (MarsUI Dashboard masters inset media panels 8px inline; material3 keeps full-bleed zero via its override).
--ki-card-media-radiusdimension used by the card component for slotted media corner radius (MarsUI nested media panel Radius/big_component/radius_sm 20px; formalizes the fallback ki-card.css already consumes).
--ki-card-outlined-bgPage-coloured background for an outlined card.
--ki-card-outlined-borderBoundary colour for an outlined card.
--ki-card-outlined-border-widthHairline width for an outlined card.
--ki-card-outlined-fgText on the outlined card background.
--ki-card-padding-blockdimension used by the card component for the surface block padding (16px carried by the card surface itself so stacked region paddings no longer double to 32px; formalizes the fallback ki-card.css already consumes).
--ki-card-radiusdimension used by the card component for radius (MarsUI card surfaces ride the big_component scale: Dashboard_info 400x128 binds radius_xs 16px; large Chart cards anchor radius_lg 28px).
--ki-card-title-familyFamily used for a clickable card title.
--ki-density-space-scaleMultiplies every scaled container padding and gap (card, dialog, alert, list, list item, select listbox, tab panel, tooltip).
--ki-density-target-minThe smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1).
--ki-elevation-e2MarsUI Elevation/e2 (cumulative: e1 layers plus 0/3/3/-1.5).
--ki-elevation-noneFlat surfaces carry no resting shadow.
--ki-focus-ring-colorColour of the keyboard focus ring every focusable component draws: 3:1 or more against the page in every theme and scheme.
--ki-focus-ring-offsetGap between a focusable component and its keyboard focus ring.
--ki-focus-ring-widthThickness of the keyboard focus ring every focusable component draws (its outline). One token instead of one per component, so a mode or a theme changes every ring at once.
--ki-motion-distance-smMotion travel distance sm (4px): small slide/settle offsets.
--ki-motion-duration-fastFast interaction transition duration.
--ki-motion-duration-medium-1M3 md.sys.motion.duration.medium1 (250ms). onmars: MarsUI moderate step (240ms, 2x the 120ms base).
--ki-motion-easing-outDecelerating interaction transition easing curve.
--ki-motion-easing-standardStandard interaction transition easing curve.
--ki-typography-family-bodysemantic font family for typography family body.
--ki-typography-line-height-title-1semantic dimension for typography line height title 1.
--ki-typography-size-title-1semantic dimension for typography size title 1.

Supply a heading in the header slot at the level required by the page outline. In a clickable card, the title is the name of the primary link or button. Tab reaches it once, with a focus ring around the card, and reaches each secondary control separately. Supporting text remains selectable. Use the title link for native link gestures such as opening a new tab.

Open ki-card in Storybook