npx shadcn@4.23.1 add @goop/meadow-cardCard
FreeA framed surface that holds one piece of content, a list of rows or a section's words, for React and Tailwind CSS. Free, MIT.
What an agent sees
- CardHeaderButtonA quiet button in a card's header strip
- CardActionThe tile's action at its top end (12 px in from the top and the end, its items 8 px apart)
- CardHeaderThe panel's header (a
header) on the card fill, 12 px in on every side, 42 px tall for one line of words - CardMediaA picture at the start of a CardList row or a CardHeader
- CardSheetThe tray's raised sheet, under its header strip
- CardContentThe panel's padded body
- CardTitleThe title
- CardDescriptionA muted line or two under the card's title that says what the card or the row holds
- CardFooterA small grey line of words, not a footer bar
import { CardFooter } from '@/components/ui/goop/card';
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardHeaderButton,
CardMedia,
CardSheet,
CardText,
CardTitle,
} from '@/components/ui/goop/card';
import { IconButtonIcon } from '@/components/ui/goop/icon-button';
function SurveyTile() {
return (
<Card asChild>
<a href="#ridge">
<CardText>
<CardTitle>Ridge survey</CardTitle>
</CardText>
</a>
</Card>
);
}
function NewEvent({ onAdd, onClose }: { onAdd(): void; onClose(): void }) {
return (
<Card variant="tray" size="sm">
<CardHeader>
<CardMedia className="bg-fuchsia-fill">
<IconButtonIcon icon="calendar" box={{ w: 10, h: 10 }} />
</CardMedia>
<CardTitle>Calendar</CardTitle>
<CardAction>
<CardHeaderButton onClick={onAdd}>Add to calendar</CardHeaderButton>
<hr />
<CardHeaderButton aria-label="Dismiss event" onClick={onClose}>
<IconButtonIcon icon="x" box={{ w: 12, h: 12 }} />
</CardHeaderButton>
</CardAction>
</CardHeader>
<CardSheet>
<CardContent>
<span className="flex items-center gap-1.5">
<span aria-hidden className="h-4 w-0.5 rounded-sm bg-icon" />
<CardTitle>Planting day</CardTitle>
</span>
<CardDescription>Nov 21, 9–12</CardDescription>
<CardDescription>Meet at the barn.</CardDescription>
<span className="my-0.5">mira@example.com</span>
<span className="my-0.5">Public · Busy</span>
</CardContent>
</CardSheet>
</Card>
);
}Pick any look of the card: the plain outline card or the tile — retitle it, make the whole card one button (hover, press, focus, disabled; a press counts) — the list card (CardList: open a folder, take the rows away to see its empty row and make one from it, put a CardContent above them), or the theme’s own frames as its docs stage draws them (on Trail the outline frame round the theme’s rows: settings, switches, tile rows, sessions, the status card, the profile form …; on Meadow the list, the panel, the tray, the cover, the promo and the drafted email and event), with Disabled holding their controls. Nothing is saved: a press is only counted, and the rows’ switches and selects hold their own values.
When to use
- A framed surface that holds one piece of content, a list of rows or a section's words.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Card on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.
npx shadcn@4.23.1 add @goop/meadow-cardAdd the Goop Card to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { CardFooter } from '@/components/ui/goop/card';
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardHeaderButton,
CardMedia,
CardSheet,
CardText,
CardTitle,
} from '@/components/ui/goop/card';
import { IconButtonIcon } from '@/components/ui/goop/icon-button';
function SurveyTile() {
return (
<Card asChild>
<a href="#ridge">
<CardText>
<CardTitle>Ridge survey</CardTitle>
</CardText>
</a>
</Card>
);
}
function NewEvent({ onAdd, onClose }: { onAdd(): void; onClose(): void }) {
return (
<Card variant="tray" size="sm">
<CardHeader>
<CardMedia className="bg-fuchsia-fill">
<IconButtonIcon icon="calendar" box={{ w: 10, h: 10 }} />
</CardMedia>
<CardTitle>Calendar</CardTitle>
<CardAction>
<CardHeaderButton onClick={onAdd}>Add to calendar</CardHeaderButton>
<hr />
<CardHeaderButton aria-label="Dismiss event" onClick={onClose}>
<IconButtonIcon icon="x" box={{ w: 12, h: 12 }} />
</CardHeaderButton>
</CardAction>
</CardHeader>
<CardSheet>
<CardContent>
<span className="flex items-center gap-1.5">
<span aria-hidden className="h-4 w-0.5 rounded-sm bg-icon" />
<CardTitle>Planting day</CardTitle>
</span>
<CardDescription>Nov 21, 9–12</CardDescription>
<CardDescription>Meet at the barn.</CardDescription>
<span className="my-0.5">mira@example.com</span>
<span className="my-0.5">Public · Busy</span>
</CardContent>
</CardSheet>
</Card>
);
}- Fits: states (its recipe).
- The tile's words go in a CardText (CardTitle, CardDescription, CardFooter), its action in a CardAction. The panel's parts go straight in it, in their order: a CardHeader first when it has one, then CardLists and CardContents; its own words, facts or meters in a
CardContent, never in adivpadded by hand; a Table straight in it (never in a CardContent), where it takes the card's gutter by itself. A settings card's rows are Fields, not a CardList:Card variant="outline" asChildround aul(or aulstraight in it, after its CardHeader), each aField as="li"; the card sets each row 12 px in and rules them with its divider. - More on where it goes: card--options.md
- height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| variant | default | outline | tray | filled | cover | promo = default | |
| size | md | sm = md |
- Each option with its sentence: card--options.md
| Part | What it is |
|---|---|
| CardHeaderButton | A quiet button in a card's header strip; also takes type?: 'button' | 'submit' | 'reset' = 'button'; onClick?: (event: MouseEvent) => void; disabled?: boolean |
| CardAction | The tile's action at its top end (12 px in from the top and the end, its items 8 px apart); in a CardHeader, the header's action at its end, its items 12 px apart, centred on the title's line; its props: card--action.md |
| CardHeader | The panel's header (a header) on the card fill, 12 px in on every side, 42 px tall for one line of words; its title at its start and its action at its end, 10 px apart, centred on the title's line |
| CardMedia | A picture at the start of a CardList row or a CardHeader |
| CardSheet | The tray's raised sheet, under its header strip |
| CardContent | The panel's padded body |
| CardTitle | The title; takes asChild |
| CardDescription | A muted line or two under the card's title that says what the card or the row holds |
| CardFooter | A small grey line of words, not a footer bar |
- CardText
- Class recipes (cva): cardVariants (Card)
CardAction
The tile's action at its top end (12 px in from the top and the end, its items 8 px apart); in a CardHeader, the header's action at its end, its items 12 px apart, centred on the title's line.
import { CardAction } from '@/components/ui/goop/card';Options
- reveal?: boolean = false — A pointer behaviour: hidden at rest, shown under the pointer, the press or the keyboard's focus on the card.
Card: every option
import { Card } from '@/components/ui/goop/card';Compose
- A CardHeader's parts go straight in it: a
CardMediafirst when there is one, itsCardTitle, aCardDescriptionand its action (aCardActionholding the theme's Button or IconButton). A whole tile as a button:Card asChildround the caller'sbutton type="button", a CardText in it; never round a card whose rows hold controls of their own. The tray: a CardHeader (a CardMedia holding a 16 px icon, its CardTitle, a CardAction holding a quiet Button) then one CardSheet holding CardContent sections, each a CardText (CardTitle, CardDescription) and what follows it. The filled panel: a CardHeader (a CardMedia holding a 36 px avatar, its CardTitle, a CardDescription, a CardAction) then a CardContent whose children are its rows, each alabelholding a CardText and the theme's Switch. The cover: a CardMedia holding the xl solid Avatar — to change the photo, that AvatarasChildon abutton type="button"named for what it does, as a DropdownMenuTrigger's child, its menu's rows the photo's actions — then a CardHeader holding a CardTitle (the name) and a CardDescription (the email). Under it one CardSheet: a draft'sField orientation="inline"rows and aTextarea variant="bare", or CardContent sections (a CardTitle, CardDescriptions, your own lines). - CardHeaderButton: In a CardHeader's CardAction, as
<CardHeaderButton onClick={send}>Send email</CardHeaderButton>, anhr, then<CardHeaderButton aria-label="Dismiss draft" onClick={dismiss}>holding one pack icon. The card removes nothing itself: on close, take the card away and move the focus to the next one.
Options
- variant: default (default), outline, tray, filled, cover, promo
- size: md (default), sm
- asChild?: boolean = false — Draw the card on the caller's own element (the button or link a tile is), merging the card's props onto it.
Accessibility
- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| disabled | the prop disabled |
Motion
- The part sets its own motion: add no transition or animation of your own.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.