Metric card
A compact summary for a number that needs context.
A contained group of related content and actions.
npx shadcn@latest add @silicon-ui/cardnpx shadcn@latest add @silicon-ui/cardInstall the dependencies.
npm install @radix-ui/react-dialog lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/card/card.tsxcomponents/silicon-ui/card/card.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
title* | string | — |
description | string | — |
media | ReactNode | — |
action | ReactNode | — |
avatarA small leading visual for the footer, such as the owner's avatar. | ReactNode | — |
metaWho the card belongs to, such as the owner's name. | ReactNode | — |
statusA short status under the meta, such as "Updated 2 hours ago". Changed words rise in and are announced politely. | string | — |
detailsContent for a quick look. When set, the whole card opens and grows into a larger view; Escape or the close control morphs it back. | ReactNode | — |
open | boolean | — |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | — |
Also accepts the props of HTMLAttributes<HTMLElement>.