Card
interlace-ui/cardFreeComponent
A bordered, rounded content surface with header / title / description / action / content / footer parts. The surface, radius and border come from `Box`; the card owns only its column layout, its padding and its shadow.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/card.jsonSource
1import * as React from 'react';23// @interlace/card v1.2.0 — Interlace design system.4// Docs, props and live preview: https://ds.interlace.tools/c/card5// What changed since: https://ds.interlace.tools/c/card#history6// Generated banner — keep it, the upgrade diff reads this version.78/**9 * @interlace/ui — Card10 *11 * A bordered, rounded content surface with header / title / description /12 * action / content / footer parts. The surface, radius and border come from13 * `Box`; the card owns only its column layout, its padding and its shadow.14 *15 * A `loading` card renders the shape-matched `Skeleton variant="card"`16 * instead, so a card grid does not shift when the data lands.17 *18 * ## Anatomy19 *20 * Card (Box — surface=card, radius=lg, border, flex-col gap-6 py-6)21 * ├─ CardHeader (grid — @container/card-header, px-6)22 * │ ├─ CardTitle23 * │ ├─ CardDescription24 * │ └─ CardAction (col 2, spans both header rows)25 * ├─ CardContent (px-6)26 * └─ CardFooter (flex, px-6)27 *28 * The header is a one-column grid until a `CardAction` is present:29 * `has-data-[slot=card-action]` switches it to `[1fr_auto]`, so the action30 * column is created by the child that needs it rather than by a prop.31 *32 * ## What the card does not give you33 *34 * `CardTitle` is a `<div>`, not a heading. It carries the type treatment and35 * nothing else, so a card that participates in the document outline needs the36 * caller to put a real `<h2>`/`<h3>` inside it. Only `Card` takes `loading` —37 * the parts have no state contract of their own.38 *39 * | Rule | Concept | Where in this file |40 * | ---- | -------------------------------- | ----------------------------------------------------------- |41 * | R4 | Extends native el | `React.ComponentProps<'div'>` on every part |42 * | R6 | data-slot per part | card / -header / -title / -description / -action / -content / -footer |43 * | R7 | cn + ...rest | `cn('px-6', className)` + `{...props}` on each part |44 * | R10 | Composition seam | header layout keys off the `card-action` slot, not a prop |45 * | R12 | Reuse over wrap | `Box` owns surface + radius + border; `Skeleton` owns loading |46// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| A11y Startera11y-starter | interlace-ui | Components | Free | no deps | |
| Accordionaccordion | interlace-ui | Components | Free | no deps | |
| Alertalert | interlace-ui | Components | Free | no deps | |
| Alert Dialogalert-dialog | interlace-ui | Components | Free | no deps | |
| Animated Gradient Textanimated-gradient-text | interlace-ui | Components | Free | no deps | |
| Animated Grid Patternanimated-grid-pattern | interlace-ui | Components | Free | no deps | |
| Animated Listanimated-list | interlace-ui | Components | Free | no deps | |
| Article Cardarticle-card | interlace-ui | Components | Free | no deps |
