# Blog Post Page

> A React blog post template: byline, share actions, a drawn cover, a Markdown body with a sticky table of contents and reading progress.

- Type: React template (Templates)
- Access: Pro (the source needs a Wingo UI Pro plan, see https://wingo-ui.com/pricing)
- Version: 1.1.0
- Install: `npx wingo-ui@latest add blog-post-page`
- Docs: https://wingo-ui.com/templates/blog-post-page

## Interaction

A thin bar at the top of the window fills as you read. The breadcrumb links back to the blog and the category (on phones it becomes one back link). Copy link copies the address and turns into "Link copied" for two seconds; X, LinkedIn and email open a share in a new tab. The article is rendered from Markdown: headings, lists, a code block with a copy button, a quote, a table that scrolls sideways on phones and a figure drawn in code. On desktop the table of contents sticks beside the article, marks the section being read with a progress ring and jumps to a section on click; below 1024px it becomes a pill pinned under the header that opens a bottom sheet. Was this helpful? answers Yes with a thank-you, or No with a short comment box. The author card links to more posts, the three related posts are single links, and the newsletter band validates the email and confirms inline.

## Installation

```bash
npx wingo-ui@latest add blog-post-page
```

Pro item: run `npx wingo-ui@latest login` once with a Pro account. The CLI adds the files, their dependencies and a version record for updates.

With shadcn: `npx shadcn@latest add @wingo-ui/blog-post-page` (needs the @wingo-ui registry with your API key in components.json)

Files:

- `components/templates/blog-post-page.tsx`
- `components/templates/blog-post-page-data.ts`

npm dependencies: `npm i motion lucide-react`

Wingo UI dependencies (installed automatically):

- [Blog Page](https://wingo-ui.com/templates/blog-page) ([Markdown](https://wingo-ui.com/templates/blog-page.md))
- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))
- [Marketing Header](https://wingo-ui.com/components/marketing-header) ([Markdown](https://wingo-ui.com/components/marketing-header.md))
- [Marketing Footer](https://wingo-ui.com/components/marketing-footer) ([Markdown](https://wingo-ui.com/components/marketing-footer.md))
- [Avatar](https://wingo-ui.com/components/avatar) ([Markdown](https://wingo-ui.com/components/avatar.md))
- [Breadcrumb](https://wingo-ui.com/components/breadcrumb) ([Markdown](https://wingo-ui.com/components/breadcrumb.md))
- [Button](https://wingo-ui.com/components/button) ([Markdown](https://wingo-ui.com/components/button.md))
- [Markdown](https://wingo-ui.com/components/markdown) ([Markdown](https://wingo-ui.com/components/markdown.md))
- [Table Of Contents](https://wingo-ui.com/components/table-of-contents) ([Markdown](https://wingo-ui.com/components/table-of-contents.md))
- [Textarea](https://wingo-ui.com/components/textarea) ([Markdown](https://wingo-ui.com/components/textarea.md))
- [Motion presets](https://wingo-ui.com/components/motion) ([Markdown](https://wingo-ui.com/components/motion.md))
- [Navigation](https://wingo-ui.com/components/navigation) ([Markdown](https://wingo-ui.com/components/navigation.md))
- [Tones](https://wingo-ui.com/components/tones) ([Markdown](https://wingo-ui.com/components/tones.md))
- [UIProvider](https://wingo-ui.com/components/ui-config) ([Markdown](https://wingo-ui.com/components/ui-config.md))

## Usage

```tsx
// app/(marketing)/blog/[slug]/page.tsx
"use client"

import Link from "next/link"
import { notFound, useParams } from "next/navigation"
import { BlogPostPage } from "@/components/templates/blog-post-page"
import { BLOG_ARTICLE_SAMPLE } from "@/components/templates/blog-post-page-data"

export default function BlogPostRoute() {
  const { slug } = useParams<{ slug: string }>()
  if (slug !== BLOG_ARTICLE_SAMPLE.slug) notFound()
  return (
    <BlogPostPage
      linkComponent={Link}
      article={BLOG_ARTICLE_SAMPLE}
      onFeedback={(helpful, comment) =>
        fetch("/api/feedback", { method: "POST", body: JSON.stringify({ slug, helpful, comment }) })
      }
    />
  )
}
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `design?` | `"classic" \| "editorial" \| "minimal"` | `"classic"` | The whole page's look. classic follows the layout props on a glow with muted bands; editorial: a soft page, a centered header, a display-size title, the byline under a heavy rule, a square wide cover, the contents on the left of a narrow reading column, quotes set as pull quotes between rules, ruled boxes, related posts as ruled rows, a split newsletter and a centered footer; minimal: a plain page, a transparent header, a narrower page with no cover, a plain byline, flat outlined boxes, related posts as text lines, no band and a simple footer. headerProps and footerProps still win. |
| `article?` | `BlogArticle` | `"BLOG_ARTICLE_SAMPLE"` | The post: BlogPost fields plus subtitle, body (Markdown), tags and url (for share links; default the page's own address). |
| `relatedPosts?` | `BlogPost[]` | `"BLOG_RELATED_SAMPLE"` | Up to three cards under the article. |
| `categories?` | `BlogCategory[]` | `"BLOG_CATEGORIES"` | Display names for category values. |
| `figures?` | `Record<string, BlogFigureBar[] \| ReactNode>` |  | Drawn figures for Markdown images whose src is #figure-<name>: bars for a bar chart, or any node. The sample has render-times. |
| `labels?` | `Partial<BlogPostPageLabels>` | `"DEFAULT_BLOG_POST_PAGE_LABELS"` | Every visible string: share, contents, feedback, author, related and newsletter copy. |
| `showProgress?` | `boolean` | `true` | The reading progress bar at the top of the window. |
| `showToc?` | `boolean` | `true` | The table of contents: sticky beside the article on desktop, a pill and a sheet on phones. |
| `showShare?` | `boolean` | `true` | Copy link, X, LinkedIn and email, in the byline and after the article. |
| `showCover?` | `boolean` | `true` | The cover under the byline (the minimal design has none). |
| `showFeedback?` | `boolean` | `true` | The "Was this helpful?" box. |
| `showAuthor?` | `boolean` | `true` | The author bio card. |
| `showRelated?` | `boolean` | `true` | The related posts section. |
| `showNewsletter?` | `boolean` | `true` | The newsletter band before the footer. |
| `header?` | `boolean` | `true` | The sticky marketing header; turn it off when the page sits in a site layout. |
| `footer?` | `boolean` | `true` | The marketing footer. |
| `headerProps?` | `Partial<MarketingHeaderProps>` |  | Passed to MarketingHeader. |
| `footerProps?` | `Partial<MarketingFooterProps>` |  | Passed to MarketingFooter. |
| `tocVariant?` | `"line" \| "dots" \| "plain"` | `"line"` | The table of contents' look: a rail with a moving indicator, dots or plain links. |
| `cardVariant?` | `"plain" \| "raised"` | `"plain"` | Related post cards right on the page or on surface cards. Applies to the classic design. |
| `covers?` | `"color" \| "mono"` | `"color"` | Drawn covers tinted per category, or neutral. |
| `tone?` | `"neutral" \| "brand" \| "success" \| "warning" \| "danger" \| "info"` | `"neutral"` | The progress bar, the active contents entry, links, figure bars and the buttons. |
| `background?` | `"plain" \| "soft" \| "glow" \| "aurora" \| "grid" \| "dots"` | `"glow"` | The main background: plain is the bare page color; the others tint the page and add a glow, an aurora, a grid or dots over the first screen. A design picks its own unless you set one. |
| `backgroundColor?` | `string` | `"oklch(0.62 0.14 275)"` | The tint and glow color of the main background. |
| `bandBackground?` | `"muted" \| "tinted" \| "gradient" \| "dots"` | `"muted"` | The secondary background of the alternating bands. Cards, fields and tiles inside a band are lifted one step above it, so they never share its color. |
| `bandColor?` | `string` | `"oklch(0.62 0.14 275)"` | The tint of tinted and gradient bands; defaults to backgroundColor. |
| `radius?` | `"sm" \| "md" \| "lg"` | `"md"` | Radius of the cover, cards and boxes. |
| `animateIn?` | `boolean` | `true` | The article header rises in once on mount; off in thumbnails and under reduced motion. |
| `locale?` | `string` | `"en-US"` | Intl locale for dates and figure numbers. |
| `blogHref?` | `string` | `"/blog"` | Where Blog in the breadcrumb and All posts link; the category crumb adds ?category=<value>. |
| `onFeedback?` | `(helpful: boolean, comment?: string) => (void \| Promise<unknown>)` |  | Was this helpful?; called on Yes, on No and again with the comment. A returned promise keeps the button loading; without it the page waits 600 ms. |
| `onSubscribe?` | `(email: string) => (void \| Promise<unknown>)` |  | The newsletter signup; without it the form waits 900 ms and succeeds. |
| `markdownProps?` | `Partial<MarkdownProps>` |  | Passed to the article's Markdown (components, codeLineNumbers, linkTarget...). |
| `linkComponent?` | `(props: LinkComponentProps) => ReactNode` | `"<a>"` | The router link for every link (next/link in an app); default the LinkProvider's. |
| `className?` | `string` |  | Classes for the root. |
| `classNames?` | `Partial<Record<BlogPostPageSlot, string>>` |  | Classes for progress, hero, breadcrumb, title, byline, share, cover, toc, body, tags, feedback, author, related and newsletter. |

## Parts

### BlogBarFigure (component)

A horizontal bar chart drawn with spans, so it can sit inside a Markdown paragraph. Takes span props.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `bars?` | `BlogFigureBar[]` |  | { label, value } rows. |
| `caption?` | `ReactNode` |  | The line under the chart (the image alt text). |
| `unit?` | `string` | `"ms"` | Printed after each value. |
| `locale?` | `string` | `"en-US"` | Number format. |

### markdownToc (function)

markdownToc(source) returns the h2 and h3 of a Markdown string as TocItem[], with the ids Markdown's headingIds gives them.

### BLOG_ARTICLE_SAMPLE (constant)

The sample article: "How we made Acme's board 10x faster" by Noah Mitchell.

### BLOG_RELATED_SAMPLE (constant)

Three related posts from BLOG_POSTS.

### DEFAULT_BLOG_POST_PAGE_LABELS (constant)

The English strings.

### BlogArticle (type)

BlogPost & { subtitle?, body, tags?, url? }.

### BlogFigureBar (type)

One bar of a BlogBarFigure chart: { label, value }.

### BLOG_POST_PAGE_DESIGNS (constant)

The design names, classic first: ["classic", "editorial", "minimal"].

### BlogPostPageProps (type)

Props of BlogPostPage.

### BlogPostPageDesign (type)

"classic" | "editorial" | "minimal".

## Examples

- **Editorial design**: design="editorial": a display title over a heavy rule, a narrow reading column with the contents on the left, pull quotes and ruled related rows.
- **Minimal design**: design="minimal": no cover, a plain byline, flat outlined boxes and related posts as plain text lines.
- **Brand tone, raised cards**: The marketing orange on the progress bar, the contents and the buttons; related posts on surface cards.
- **Dots contents, monochrome**: The dotted table of contents, neutral covers and a larger radius.
- **Reading mode**: No cover, share, feedback or newsletter: just the article, its contents and the author.
- **Inside a site layout**: Header and footer off, for a blog that already has its own chrome.

## See also

- [Blog Page](https://wingo-ui.com/templates/blog-page) ([Markdown](https://wingo-ui.com/templates/blog-page.md))
- [Markdown](https://wingo-ui.com/components/markdown) ([Markdown](https://wingo-ui.com/components/markdown.md))
- [Table Of Contents](https://wingo-ui.com/components/table-of-contents) ([Markdown](https://wingo-ui.com/components/table-of-contents.md))
- [Breadcrumb](https://wingo-ui.com/components/breadcrumb) ([Markdown](https://wingo-ui.com/components/breadcrumb.md))
- [Marketing Section](https://wingo-ui.com/components/marketing-section) ([Markdown](https://wingo-ui.com/components/marketing-section.md))

---

Canonical: https://wingo-ui.com/templates/blog-post-page
More components: https://wingo-ui.com/components · Index for agents: https://wingo-ui.com/llms.txt
