Card
A bordered container for a self-contained block of content.
Account
Current periodAug 1 - Aug 31
<template> <Card title="Account"> <div class="flex flex-col gap-3">Content</div> </Card></template>Props
| Name | Type | Default |
|---|---|---|
| title | string | - |
| subtitle | string | - |
| tooltip | string | - |
| tooltipLabel | string | - |
| icon | string | - |
Slots
| Name | Description |
|---|---|
| header-actions | Trailing content (buttons, dropdowns, a ChartLegend) next to the title/subtitle stack. Only rendered when `title` is set. There is no raw header slot: the title/subtitle props are the only card header. |
| default | Body content. Any internal layout/gap (e.g. `flex flex-col gap-3`) is the caller's own wrapper div inside this slot. |
| body | Explicit name for the body region - identical to the default slot, for callers who want it spelled out next to #footer. Ignored when a default slot is also passed. |
| footer | Optional action row at the bottom of the card. |
Guidelines
Do
- Use it as a bordered container for a self-contained block of content - a stat, an account summary, a settings panel.
- Put internal layout/spacing (e.g.
flex flex-col gap-3) on your own wrapper div inside the default slot - Card doesn't expose a way to override its own body padding per instance. Content is deliberately freeform; there's no standard label/value or stat layout to reach for. - Same for
footer- it carries no alignment of its own, so a single action reads left-aligned by default. Wrap it in your ownflex justify-end gap-2if you want right-aligned actions (the convention modals use); that's a caller choice, not Card's default.
- Use
title/subtitle/tooltip/iconfor a standard header - Card renders it for you (label-01-medium text-text-tertiarytitle,body-05-regular text-text-tertiarysubtitle, tooltip inline with the title, icon leading the title/subtitle stack). The icon sits in its ownh-5 flex items-centerbox, matching the title's line-height, and that box top-aligns with the title's line rather than centering across both lines - same technique as the checkbox box in checkbox.vue'scardvariant. Put trailing actions (dropdowns, buttons) in theheader-actionsslot, which gets the sameh-5treatment and also top-aligns with the title's line, not the full title+subtitle block. #bodyis an explicit name for the default slot (the region between header and footer) - use it when spelling out all three regions reads better than an anonymous default; passing both makes the default slot win.- Use the
footerslot for an action row at the bottom. There is noheaderslot: a card's header is always thetitle/subtitle/tooltip/iconprops plus#header-actions, so headers look the same on every card and can't be restyled per call site.
Don't
- Don't reach for
:ui/classto change Card's background, border, corners, or padding - there's one fixed look, not a set of variants. - Don't nest a
borderor a secondbg-surface-cardinside the default slot to fake a section divider - a plain<div class="h-px bg-stroke-primary" />is enough.
Examples
Subtitle and tooltip
subtitle sits under the title; tooltip renders inline next to it via InfoTooltip.
Findings by severity New findings introduced per day, last 7 days
Chart goes here
<template> <Card title="Findings by severity" subtitle="New findings introduced per day, last 7 days" tooltip="Counts findings at the time they were first introduced, not their current status." > <div class="h-20 flex items-center justify-center body-05-regular text-text-tertiary"> Chart goes here </div> </Card></template>Leading icon and header actions
icon leads the title/subtitle stack; header-actions renders trailing content like a connect button.
Slack Get notified in a channel when new findings are found.
Not connected
<template> <Card icon="i-logos-slack-icon" title="Slack" subtitle="Get notified in a channel when new findings are found." > <template #header-actions> <Button variant="secondary" size="sm">Connect</Button> </template> <span class="body-04-regular text-text-tertiary">Not connected</span> </Card></template>Footer
footer is a separate action row at the bottom of the card, visually separated by padding.
Danger zone
Deleting this organization removes all its data and cannot be undone.
<template> <Card title="Danger zone"> <p class="body-04-regular text-text-tertiary"> Deleting this organization removes all its data and cannot be undone. </p> <template #footer> <Button variant="destructive" size="sm">Delete organization</Button> </template> </Card></template>