---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Card

A framed surface that holds one piece of content or a list of settings rows, for React and Tailwind CSS. Free, MIT.

Free. Its export: `Card`.

## Try it

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 or a list of settings rows.

## When not to use

- To set several cards out in a grid, use CardGrid.

## 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.

```sh
npx shadcn@4.23.1 add @goop/trail-card
```

```text
Add the Goop Card to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { Card, CardAction, CardText, CardHeader, CardMedia, CardContent, CardTitle, CardDescription, CardFooter } from '@/components/ui/goop/card';
import { CardList } from '@/components/ui/goop/card-list';
import { Item, ItemOverlay, ItemContent, ItemTitle, ItemDescription } from '@/components/ui/goop/item';
import { ProgressCircle } from '@/components/ui/goop/progress-circle';
import { Button } from '@/components/ui/goop/button';

<>
  <Card variant="outline">
    <CardHeader>
      <CardTitle asChild>
        <h3>Shared folders</h3>
      </CardTitle>
      <CardDescription>Folders the team can open</CardDescription>
    </CardHeader>
    <CardContent>Shared last week.</CardContent>
    <CardList aria-label="Shared folders" empty={{ title: 'No folders shared yet' }}>
      <Item asChild>
        <li>
          <ItemOverlay asChild>
            <a href="/folders/notes" aria-label="Open Field notes" />
          </ItemOverlay>
          <ItemContent>
            <ItemTitle>Field notes</ItemTitle>
            <ItemDescription>Notes from the last visit</ItemDescription>
          </ItemContent>
        </li>
      </Item>
    </CardList>
  </Card>
  <Card asChild>
    <button type="button" onClick={openSettings}>
      <CardText>
        <CardTitle>Workspace settings</CardTitle>
        <CardDescription>Name, address and defaults</CardDescription>
      </CardText>
    </button>
  </Card>
  <Card variant="outline">
    <CardHeader>
      <CardMedia>
        <ProgressCircle
          size="lg"
          value={42}
          max={50}
          role="meter"
          aria-label="Seats"
          aria-valuetext="42 of 50 seats taken"
        />
      </CardMedia>
      <CardTitle asChild>
        <h3>Seats</h3>
      </CardTitle>
      <CardDescription>42 of 50 taken this month</CardDescription>
      <CardAction>
        <Button variant="ghost" shape="pill" size="lg" onClick={openSettings}>
          Manage seats
        </Button>
      </CardAction>
    </CardHeader>
  </Card>
</>
```

- Fits: states, account, flow, list, overview, record, settings (their recipes).
- CardText is the tile's column of words, with no inside of its own: the tile holds it 12 px in. An outline card's own content (words, MetaFacts, meters) goes under its CardHeader in a `CardContent`, never in a CardText or a hand-padded `div`. An outline card's Item rows go in a `CardList` (each an `Item asChild` on an `li`; a whole row as a link: `ItemOverlay asChild` round the `a`), never a bare `ul`; with no rows, its `empty` words show. An outline card's Table goes straight under its CardHeader, never in a CardContent: it takes the card's gutter by itself. A settings card's rows are Fields, not Items: `Card variant="outline" asChild` round a `ul`, each a `Field as="li"`, no CardList.
- More on where it goes: card--options.md
- height, width, padding, gap, corner, border, background, shadow, text: add no class for these.

## API reference

### Options

- `variant: default | outline = default`
- `asChild?: boolean = false` — Draw the card on your own element (the button or link a tile is).

- Another example of it: bar-list.md, card-list.md, field.md, item.md, number-input.md, scroll-area.md

### Parts

- `CardAction` — The tile's action at its top end (12 px in from the top and the end, its items 6 px apart); its props: card--action.md
- `CardText` — The tile's column of words
- `CardHeader` — The header inside the list frame, above its rows (a `header`, the banner)
- `CardMedia` — The header's picture at its start
- `CardContent` — The card's padded body
- `CardTitle` — The title; takes asChild
- `CardDescription` — A muted line or two under the card's title that says what the card holds
- `CardFooter` — A small grey line of words, not a footer bar

- 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 6 px apart).

```tsx
import { CardAction } from '@/components/ui/goop/card';
```

### Options

- reveal?: boolean = false — Hidden at rest, shown under the pointer, the press or the keyboard's focus on the card; shown on a touch screen.

### Card: every option

```tsx
import { Card } from '@/components/ui/goop/card';
```

### Compose

- A CardHeader holds only its parts, straight in it (no `div` round the title and description): a `CardMedia` first (a ring, an avatar or an icon tile), its `CardTitle`, a `CardDescription` and its action (a `CardAction` or a Button). CardHeader is the outline card's: in a tile its title stands 16 px further in than the tile's words. A whole tile as a button: `Card asChild` round the caller's `button type="button"`, a CardText in it. A whole outline card as a button: `Card variant="outline" asChild` round the button, its words in a CardText with `className="p-4 max-narrow:p-2.5"` (no CardHeader); never round an outline card whose rows hold controls of their own. A border of your own in place of the card's edge takes it away: `ring-0 dark:ring-0`.

### Options

- variant: default (default), outline
- asChild?: boolean = false — Draw the card on your own element (the button or link a tile is).
- Another example of it: bar-list.md, card-list.md, field.md, item.md, number-input.md, scroll-area.md

## Accessibility

- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

## 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.

Shortened to fit: the data-slot values.

## Related

- [Card grid](/themes/trail/components/card-grid): A grid that sets several cards out in even columns that wrap with its width, for projects, files or features.
- [Card list](/themes/trail/components/card-list): A short list of rows inside an outline card, for what is recent, due or shared.
- [Item](/themes/trail/components/item): One row of a list of records.
- [Progress circle](/themes/trail/components/progress-circle): Known progress as a ring that fills clockwise from the top.
