Components

Card

A card is a sheet of paper: header, title, description, action, content and footer with shadcn's spacing, on any stock and edge. Dividers are drawn pencil rules, and a card can be taped, pinned or clipped to the desk.

Install

terminal
npx shadcn@latest add @wobko/card

First time here? Add the registry to components.json first. How to install

Examples

Settings card

The whole family: a title and description, an action tucked into the header, content, and a footer with a pencil rule above it.

Stat cards

Index cards for one number each. The figures are set in the script font with tabular numerals; the trend says up or down in words, not only in color.

Guest book

A form on a guest check: green ledger paper, a perforated top, a dashed footer. The fields are ordinary labeled inputs; the sheet only changes the paper they are written on.

Article card

A card taped at the corners with a torn bottom edge, for something you would pin above your desk.

On every stock

A card is a sheet of paper, so it takes any stock, edge and printed rules: graph paper, a dot grid, kraft, an index card with a torn top.

Pinned, clipped, stapled

The `fastener` slot holds a card down. Calm density hides every prop, so a dense dashboard keeps its plain sheets.

Login

The shadcn demo: a title, a description, a link tucked into CardAction, a form of two labeled fields with a "forgot" link beside the second label, and a footer of two full-width buttons. Nothing is drawn but the paper, the fields and the buttons.

Create a project

The shadcn demo: a card around a small form. A text field, a Select (its list opens in `position="popper"` so it lines up with the trigger) and a footer with the two answers pushed apart. Deploy reports what it would do.

API reference

Card

A Paper with shadcn's card layout (a flex column, gap 6, py 6). It takes every Paper prop; its default stock is `card` (paper color, a small shadow).

PropTypeDefaultDescription
stockStockName"card"Paper, slip, index-card, graph, dot-grid, check, ledger, pad, kraft, napkin, sticky-*, photo, parchment, receipt.
edgeEdgeSpec"cut"Cut (pure CSS), torn, deckle, crimp, zig, perf, scallop, or one kind per side.
tiltboolean | numbertrueSeeded tilt of the sheet; text stays upright.
rulesRuleName"none"Printed rules: ruled, index, graph, dots, ledger, pad. Off by default (unlike Paper, which prints its stock's own rules) because arbitrary content does not sit on ruled lines.
tape"corner" | "top" | "both" | false-Tape strips at the corners or the top edge.
fastener"clip" | "pin" | "staple" | "binder-clip" | false-Hold the card down with a drawn prop.
seedstring | number-Pins the hand.

CardHeader

A container query grid (`@container/card-header`): title and description on the left, an optional CardAction on the right. `border-b` asks for a drawn divider and adds the usual bottom padding.

PropTypeDefaultDescription
rule"pencil" | "dashed" | "wavy""pencil"How the divider under a header with `border-b` is drawn: a pencil line that rises to the right, dashes like a ledger, or a wavy underline.

CardFooter

A flex row. `border-t` draws a divider above it and adds the top padding.

PropTypeDefaultDescription
rule"pencil" | "dashed" | "wavy""pencil"How the divider above a footer with `border-t` is drawn.

Accessibility

  • A Card is a plain div, as upstream: give it a role or an element (`as="article"`, `role="group"` with a label) when it means something more.
  • The sheet, dividers, tape and fasteners are aria-hidden decoration; nothing in them is focusable or takes pointer events.
  • Ink on paper is 14:1; muted descriptions 8.9:1. Text stays upright while the sheet turns, and the tilt is zero in calm density.
  • Calm density also draws a plain cut edge with a hairline shadow and hides tape and fasteners.

Source

The files the CLI copies into your project.

Loading the source