Skip to content

Card

Monthly revenue

€48,200 +12.5%

Spring collection

New Limited
Fresh arrivals for the new season, hand-picked by our team.

A surface for grouped content: a media card (image/icon + title + description + tags/actions) or a dashboard metric tile (value + change/trend).

<script>
import Card from "@invisible-ui/svelte/Card.svelte";
</script>
PropTypeDefaultDescription
variant"media" | "dashboard""media"Media card or metric tile.
orientation"vertical" | "horizontal""vertical"Media layout.
surface"default" | "secondary""default"Surface hierarchy. secondary uses the quieter secondary card surface token.
imageSrcstring | undefinedundefinedMedia image (falls back to the icon snippet).
imageAltstring""Media image (falls back to the icon snippet).
titlestring | Snippet | undefinedundefinedHeading: text, or a snippet for rich content. Only a text title names the card.
headingLevel2 | 3 | 4 | 5 | 63Heading level for the title.
descriptionstring | Snippet | undefinedundefinedBody text, or a snippet for rich content.
valuestring | number | undefinedundefinedDashboard metric value.
changestring | undefinedundefinedDashboard delta (e.g. "+12.5%").
trend"up" | "down" | "neutral""neutral"Tints the change.
iconSnippet | undefinedundefinedIcon in the media area (media variant) or beside the title (dashboard).
mediaSnippet | undefinedundefinedCustom media content, in place of the image or icon.
tagsSnippet | undefinedundefinedTags shown with the title.
metricSnippet | undefinedundefinedDashboard: extra content after the value and change.
actionsSnippet | undefinedundefinedActions area at the end of the card.

Snippets: media, icon, tags, actions, children (body content), metric. title and description take plain text or a snippet.

The image src is rendered as given: pass only URLs you trust or have sanitized. See Security.

<Card variant="dashboard" title="Revenue" value="€48,200" change="+12.5%" trend="up" />

In Elements, text values use attributes and rich regions stay in light DOM. Mark region content with slot; unslotted children become the body:

<ds-card title="Database" description="AdventureWorks" orientation="horizontal">
<ds-tag slot="tags" status="success">Connected</ds-tag>
<p>12 tables available.</p>
<ds-button slot="actions">Open</ds-button>
</ds-card>

Use surface="secondary" for a card that belongs to the secondary surface hierarchy. It resolves through --ds-components-card-secondary-background-default, a component token that points at the neutral surface role in the light theme and at Grey 900 in the dark one. The default surface resolves through --ds-components-card-background-default.

In React, title, description, icon, media, tags, metric and actions take markup:

<Card
title="Analytics"
description="Live data from the warehouse."
tags={<Tag status="success">Connected</Tag>}
actions={<Button>Open</Button>}
/>

Themeable via --ds-card-*.