On this page

Card

Live examples of Card, with the exact Vue file that renders each one.

Every example is a complete Vue file. Copy it into an app that has the registry installed, or open it in StackBlitz.

A title with a description, a menu button in CardAction, details, and the actions in the footer with the primary first (D10, page form order).

Online store to ERP

Sends new orders to the ERP every 15 minutes.
Status
Synced
Last run
Today, 09:45
Orders sent
1,284
CardConnection.vue
<script setup lang="ts">
import { Ellipsis } from '@lucide/vue'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
</script>

<template>
  <Card class="w-full max-w-100">
    <CardHeader>
      <CardTitle><h3 class="m-0 [font:inherit]">Online store to ERP</h3></CardTitle>
      <CardDescription>Sends new orders to the ERP every 15 minutes.</CardDescription>
      <CardAction>
        <Button variant="ghost" size="icon-sm" aria-label="More actions for Online store to ERP"><Ellipsis /></Button>
      </CardAction>
    </CardHeader>
    <CardContent>
      <dl class="m-0 grid grid-cols-[auto_1fr] gap-x-(--bh-space-200) gap-y-(--bh-space-100)">
        <dt class="text-(--bh-color-text-subtle)">Status</dt>
        <dd class="m-0"><Badge variant="success">Synced</Badge></dd>
        <dt class="text-(--bh-color-text-subtle)">Last run</dt>
        <dd class="m-0">Today, 09:45</dd>
        <dt class="text-(--bh-color-text-subtle)">Orders sent</dt>
        <dd class="m-0">1,284</dd>
      </dl>
    </CardContent>
    <CardFooter>
      <Button>Sync now</Button>
      <Button variant="outline">View history</Button>
    </CardFooter>
  </Card>
</template>

Small cards

size="sm" uses 12 px padding. Good for a row of numbers on a dashboard.

Orders today
342
12 more than yesterday
Failed syncs
3
Retried automatically
Products in stock
8,910
From 2 warehouses
CardSmall.vue
<script setup lang="ts">
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'

const stats = [
  { label: 'Orders today', value: '342', note: '12 more than yesterday' },
  { label: 'Failed syncs', value: '3', note: 'Retried automatically' },
  { label: 'Products in stock', value: '8,910', note: 'From 2 warehouses' },
]
</script>

<template>
  <div class="grid w-full grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-(--bh-space-200)">
    <Card v-for="stat in stats" :key="stat.label" size="sm">
      <CardHeader>
        <CardDescription>{{ stat.label }}</CardDescription>
        <CardTitle class="[font:var(--bh-font-heading-large)]!">{{ stat.value }}</CardTitle>
      </CardHeader>
      <CardContent class="text-(--bh-color-text-subtle) [font:var(--bh-font-body-small)]">{{ stat.note }}</CardContent>
    </Card>
  </div>
</template>