Blog, cards


Install
npx shadcn add @klarhimmel/blog-cardsDetailsAbout, usage, props and more
A grid of article cards with image, category, title, excerpt and date, plus a link to all posts.
Import
Import
- blog/cards
- Category
- Post cards, lists and the article page. New project? Set it up once: /get-started/installation.
Notes
When to use it
A grid of article cards with image, category badge, title, excerpt and date line, for a journal landing section. For an archive that is easy to scan, use blog-list.
Writing for it
- Each post title is required and holds 100 characters; write it as the thing a reader learns. Set showHeader to false when the surrounding page supplies the section heading and introduction, so the grid starts without duplicate copy or spacing. - Use the meta field (60 characters) for date and reading time together, as in 'Mar 12, 2026 · 6 min read'. It is a plain text line, so format the date yourself. - Keep the category to one word of up to 30 characters. It becomes a badge, and a long one wraps awkwardly.
Watch out for
Each post uses the href field as the destination of the title link, and nothing else on the card is a separate link. A post with an empty href still renders but points nowhere. Also, one to six posts only, with a card image forced to 16 by 10.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
showHeader | boolean | - | Optional; empty is not rendered. |
eyebrow | string | 'Name the topic' | Text, up to 60 characters. |
title | string | 'Say what the posts are about' | Text, up to 120 characters. |
description | string | 'Say in one line who writes the post…' | Text, up to 300 characters. |
posts | { category, title, excerpt, meta, href, media }[] | 3 items | List of 1 to 6. Each item: category, title (optional), excerpt, meta, href, media. |
more | Link | {…} | See the type. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |