Veil UI
Components

Card

A container for related content with header, action, content and footer slots.

Installation

$ npx veil-ui@latest add card

Usage

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.

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
Member
GGrace Hopper
Member
AAlan Turing
Member

CardAction occupies the second grid column and spans both header rows.

Metric

Requests this month
128,430

12.4%vs last month

Anatomy

SlotElementNotes
CarddivVertical flex container with border and shadow
CardHeaderdivGrid with optional action column
CardTitledivMedium weight, tight leading
CardDescriptiondivMuted, small text
CardActiondivTop-right slot
CardContentdivHorizontal padding, no vertical padding
CardFooterdivAligned 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 — CardTitle renders a div by default.
  • Use asChild-style composition manually if you need an article, section or li wrapper.
  • 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>

On this page