Card

Bordered surface with header, title, description, action, content and footer slots.

Installation

pnpm dlx shadcn@latest add @ward/card

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/card.json

Usage

import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
<Card className="w-80">
  <CardHeader>
    <CardTitle>Landing pages</CardTitle>
    <CardDescription>24 sites saved by the team.</CardDescription>
    <CardAction><Button variant="outline" size="sm">Edit</Button></CardAction>
  </CardHeader>
  <CardContent>Hero sections, pricing tables and footers worth a second look.</CardContent>
  <CardFooter><Button size="sm">Open collection</Button></CardFooter>
</Card>

Props

PropTypeDefaultDescription
classNamestring-Extra classes for the surface; every part of the card takes them too.
CardHeader classNamestring-Add border-b to draw a divider under the header and pad below it.
CardAction childrenReactNode-A control, such as a button, placed at the top right of the header beside the title and description.
CardFooter classNamestring-Add border-t to draw a divider above the footer and pad below it.

Ward · Version 1.0.0 · Registry manifest