Grid card
npx shadcn add https://ui.klarhimmel.com/r/grid-card.jsonCopy for AIExamples
Grid
Tiles
DetailsAbout, usage, props and more
One card for every grid of things: a square picture, icon or thumbnail, a title and a meta line. Rows share a height; on a phone each card is a row. For files and folders, look="tile" in a CardGrid size small or large: frameless tiles, three or two on a phone.
Preview



Garden café opening
Opening hours, the terrace and a short note for the local paper, ready before the first warm weekend of May.
Done 3 OctDone



Photos for the site
11 filesColours, type and voice.
PDF · 12 pages
Import
Import
- Files
- grid-card.tsx, in components/klarhimmel/ui/. With it: badge, theme, utils. npm: lucide-react.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
GridCard.title | ReactNode | required | One or two lines; the card's link (or button) text. |
GridCard.description | ReactNode | - | A sentence or two under the title, clamped to three lines. |
GridCard.meta | ReactNode | - | One quiet line pinned to the foot of the card: a kind, a date, a count. |
GridCard.media | GridCardMedia | - | The square at the top (beside the text on a narrow grid). Omitted: text only. |
GridCard.badge | ReactNode | - | A string becomes a neutral Badge over the media; pass a Badge for another tone. |
GridCard.pill | ReactNode | - | A short label floating over the picture's top left, such as a date. Shown only with media. |
GridCard.look | 'card' | 'tile' | 'card' | card: framed, a row beside its square below |
GridCard.href | string | - | Where the card goes. Give `href` or `onClick`, not both. |
GridCard.onClick | () => void | - | For a card that opens something in place (a side panel, a sheet). |
GridCard.link | (props: { href: string; className: string; children: ReactNode }) => ReactNode | plainLink | Renders the title link, for a router's Link. Default: a plain <a>. |
GridCard.className | string | - | Extra classes, merged after the component's own. |
CardGrid.children | ReactNode | required | |
CardGrid.label | string | - | |
CardGrid.size | keyof typeof GRID | 'default' | |
CardGrid.className | string | - | Extra classes, merged after the component's own. |
CardGridItem.children | ReactNode | required | |
GridCardSquare.media | GridCardMedia | required | The square: a picture (cover), a centred icon, any node such as a mockup thumbnail, or a folder: up to 4 of its pictures as a mosaic (the folder icon when it has none; count belongs in meta). |