Components
Card
A container for related content with header, action, content and footer slots.
Installation
$ npx veil-ui@latest add cardUsage
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
<Card>
<CardHeader>
<CardTitle>Deployment settings</CardTitle>
<CardDescription>Configure your project.</CardDescription>
</CardHeader>
<CardContent>...</CardContent>
</Card>;Examples
Basic
Deployment settings
Configure how your project is built and served.
Changes apply to the next production deployment.
With footer
Invite teammates
Anyone with the link can request access.
VA
Veil Admin
admin@veil.dev
With action
Project members
3 of 10 seats used.
AAda Lovelace
MemberGGrace Hopper
MemberAAlan Turing
MemberCardAction occupies the second grid column and spans both header rows.
Metric
Requests this month
128,430
12.4%vs last month
Anatomy
| Slot | Element | Notes |
|---|---|---|
Card | div | Vertical flex container with border and shadow |
CardHeader | div | Grid with optional action column |
CardTitle | div | Medium weight, tight leading |
CardDescription | div | Muted, small text |
CardAction | div | Top-right slot |
CardContent | div | Horizontal padding, no vertical padding |
CardFooter | div | Aligned row for actions |
API reference
All slots accept React.ComponentProps<"div">. No custom props are added.
Accessibility
- Cards are plain containers. Pick the heading level that matches your page —
CardTitlerenders adivby default. - Use
asChild-style composition manually if you need anarticle,sectionorliwrapper. - Interactive cards should expose a single focusable element rather than making the whole surface a button.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add card --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
const props = defineProps<{ class?: string }>();
</script>
<template>
<div
data-slot="card"
:class="
cn(
'flex flex-col gap-4 rounded-lg border bg-card py-5 text-card-foreground shadow-xs',
props.class,
)
"
>
<slot />
</div>
</template>