Blog, post


Install
npx shadcn add @klarhimmel/blog-postDetailsAbout, usage, props and more
An article: category, title, date and reading time, author, cover image and a reading column of body text.
Import
Import
- blog/post
- Category
- Post cards, lists and the article page. New project? Set it up once: /get-started/installation.
Notes
When to use it
A single article page: category and date, title, author, cover image and a reading column of body text. It is the article itself, so use blog-list or blog-cards for index pages.
Writing for it
- The title is the page's h1 and holds 140 characters. State the finding in it, because there is no separate intro field. - The body takes 4000 characters as plain text. Separate paragraphs with a blank line, since line breaks are kept as written. - Fill the author role (80 characters) with a job and a company, as the default does. It sits under the name beside a small round photo.
Watch out for
The title renders as an h1, so do not place another h1 block such as a hero on the same page. The body has no headings, lists, links or images, only paragraphs of text, so a long how-to needs another format.
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 |
|---|---|---|---|
category | string | 'Category' | Text, up to 30 characters. |
title | string | 'Say what the post is about, as a ti…' | Text, up to 140 characters. |
meta | string | '1 Jan 0000 · 0 min read' | Text, up to 80 characters. |
author | { name, role, photo } | {…} | Fields: name, role, photo. |
cover | Media | {…} | See the type. |
body | string | 'Open with the problem the reader kn…' | Markdown prose: paragraphs separated by blank lines, ## section headings, ### subheadings, bullet lists, bold, code, links (https or the site's own /pages) and a paragraph that is only  as a picture. Raw HTML stays text. Text, up to 12000 characters. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |