Skip to content

Card โ€‹

A surface for grouping related content with optional header and footer actions. Toggle Vue / CSS to switch the live demo and source together.

Basic โ€‹

Simple card with optional title and subtitle.

Vue SFC

Nested โ€‹

Cards stack freely inside other cards โ€” including behind v-if / v-for and while dynamic content mounts.

Vue SFC

Variants โ€‹

Elevated, outlined, flat and tonal looks.

Vue SFC

Colors โ€‹

Primary, success, danger, warning, info accents.

Vue SFC

States โ€‹

Bordered, hoverable, clickable and disabled.

Vue SFC

Actions โ€‹

Footer actions slot with multiple buttons.

Vue SFC

Event: click โ€‹

Listen for mno-click on a clickable card.

Vue SFC

Event: toggle โ€‹

Use the click event to switch the card variant.

Vue SFC

Event log โ€‹

Live log of mno-click events, distinguishing mouse vs keyboard.

Vue SFC

Dynamic content โ€‹

v-if, v-else-if, v-for, <template> blocks and <Teleport> work normally inside a card (including the "empty card that fills once a query resolves" shape). Wrap a bare v-if child in a <template> or a stable element, or use mono-helper/ui/shadow/card for no constraints.

Customized โ€‹

Override per-element styling with the cssClass prop (Vue) or extra utility classes (CSS).

Vue SFC

Sizes โ€‹

size sets the content scale โ€” padding, title and subtitle type, the header / actions / subtitle gaps and the header icon box โ€” across xs, sm, md (default), lg, xl and xxl. It does not change the card's width โ€” every card in the demo below is the same width, only the density inside differs. Use width when you want a different measure, so a compact xs card can still be wide. Corner radius stays with shape.

Changed

size used to be a 3-step density scale (compact / md / comfortable) that only changed the padding. compact is roughly sm and comfortable roughly lg; md is unchanged, so cards that never set size look exactly the same.

Vue SFC

Width & height โ€‹

Set width, height, min-width, max-width, min-height or max-height โ€” each takes a CSS string ("320px", "80%") or a number (px). Use width="100%" for a full-width card (replaces the old fullWidth).

Vue SFC

CSS Variables โ€‹

Vue SFC

Themed through --mono-card-* custom properties (they inherit and pierce the shadow boundary); an explicit --mono-card-* override wins over the size/shape/color props. Re-skin globally via the --theme-* tokens.

VariableDefaultControls
--mono-card-radius--theme-radius-xlCorner radius (set by shape, not size)
--mono-card-padding1remSection padding (header/body/actions/footer) (set by size)
--mono-card-title-font--theme-title-font-lgTitle font size (set by size)
--mono-card-subtitle-font--theme-subtitle-font-lgSubtitle font size (set by size)
--mono-card-border-width1pxBorder width (bordered โ†’ 2px)
--mono-card-border-colortheme border mixOuter border color
--mono-card-bg--theme-surfaceCard background
--mono-card-bg-softtheme background mixMedia-section background
--mono-card-text--theme-textBody text color
--mono-card-subtexttext mixed 58%Subtitle color
--mono-card-border-softtheme border mixHeader/footer divider color
--mono-card-accent--mono-card-neutralAccent (title, icon, focus ring); set by color
--mono-card-accent-rgb--mono-card-neutral-rgbAccent as r, g, b (for alpha mixes)
--mono-card-shadow--theme-elev-1Base shadow
--mono-card-shadow-elevatedelevation presetelevated / selected shadow
--mono-card-shadow-hoverelevation presetHover shadow
--mono-card-header-gap0.75remGap between icon and header text (set by size)
--mono-card-actions-gap0.5remGap between action items (set by size)
--mono-card-subtitle-gap0.25remSpace above the subtitle (set by size)
--mono-card-icon-size2.25remHeader icon box size (set by size)
--mono-card-icon-inner-size1.25remGlyph size inside the icon box (set by size)
--mono-card-hover-lift-3pxtranslateY on hover
--mono-card-focus-ring-width4pxFocus-visible ring width
--mono-card-focus-ring-offset3pxFocus-visible outline offset
--mono-card-loading-bgrgba(255,255,255,.58)Loading overlay background
--mono-card-loading-blur2pxLoading overlay backdrop blur
--mono-card-spinner-size1.35remLoading spinner size
--mono-card-spinner-width2pxLoading spinner stroke width
--mono-card-spinner-speed0.65sLoading spinner rotation duration
--mono-card-glass-bgrgba(255,255,255,.18)glass variant background
--mono-card-glass-borderrgba(255,255,255,.28)glass variant border
--mono-card-glass-blur12pxglass variant backdrop blur

The color palette is also exposed as --mono-card-{primary,secondary,success,danger,warning,info,teal,purple,dark,neutral} (each with an -rgb companion), so you can re-map a single accent color without touching the theme.

Types โ€‹

Importimport { CardProps } from 'mono-helper'
PropValueDefaultDescription
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'โ€”Content scale โ€” padding, type, gaps and the header icon. Not a dimension: use `width` / `height` for that. See {@link CardSize}.
variant'tonal' | 'gradient' | 'elevated' | 'outlined' | 'flat' | 'glass'โ€”Visual style variant of the card.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'teal' | 'purple' | 'dark' | 'light' | 'neutral'โ€”Color theme of the card.
shape'square' | 'soft' | 'round'โ€”Corner shape of the card.
mediaPosition'top' | 'bottom'โ€”Position of the media slot (top or bottom).
headingstringโ€”Title text shown in the card header.
subheadingstringโ€”Subtitle text shown under the heading.
borderedbooleanโ€”Adds a border around the card.
hoverablebooleanโ€”Adds a hover elevation effect.
clickablebooleanโ€”Makes the card interactive and clickable.
selectedbooleanโ€”Applies the selected highlight state.
disabledbooleanโ€”Disables interaction and dims the card.
loadingbooleanโ€”Shows a loading overlay on the card.
widthstring | numberโ€”Explicit sizing. Each accepts a CSS length string (`"320px"`, `"80%"`) or a number (interpreted as px). Use `width="100%"` for a full-width card.
heightstring | numberโ€”โ€”
minWidthstring | numberโ€”โ€”
maxWidthstring | numberโ€”โ€”
minHeightstring | numberโ€”โ€”
maxHeightstring | numberโ€”โ€”
headerDividerbooleanโ€”Shows a divider below the header.
footerDividerbooleanโ€”Shows a divider above the footer.
hrefstringโ€”Renders the card as an anchor with this URL.
targetstringโ€”Anchor target window when href is set.
ariaLabelTextstringโ€”Accessible label text for screen readers.
ariaLabelstringโ€”โ€”
cssClassCardCssClassโ€”Per-element class overrides.