Skip to content
SevenOne

Search documentation

Search pages and components

Card

A surface that groups related content and actions, with header, content and footer areas.

Installation

npx shadcn@latest add @sevenone/card

Usage

import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

Examples

Default

Create project
Deploy a new project in one click.
Free
<Card className="w-full max-w-sm">
  <CardHeader>
    <CardTitle>Create project</CardTitle>
    <CardDescription>Deploy a new project in one click.</CardDescription>
    <CardAction>
      <Badge variant="success"><Check /> Free</Badge>
    </CardAction>
  </CardHeader>
  <CardContent className="grid gap-2">
    <Label htmlFor="project">Name</Label>
    <Input id="project" placeholder="My project" />
  </CardContent>
  <CardFooter className="justify-end gap-2">
    <Button variant="outline">Cancel</Button>
    <Button>Create</Button>
  </CardFooter>
</Card>

Accessibility

  • Card title and description are 7:1 on the card surface.
  • Use a heading element inside CardTitle when the card starts a new section.