shadcn examples svg logo
489

Command Palette

Search for a command to run...

Sign inGet All Access

Shadcn Blog Page

Blog Page is a full-page listing block for a magazine-style blog home. A hero area pairs the latest post with a gradient image overlay and a Shadcn UI card of other featured posts, followed by a responsive Tailwind grid of recent post cards with author avatars, categories, and dates. Posts are typed and date-sorted from a single data file, so swapping in real content takes minutes. It works out of the box in React, and Vuejs and Svelte versions are also available.

Free
Blog Page preview

Other Blog Pages Examples

Get Unlimited Access to All Examples & Blocks.
Unlock everything with a single payment. Get lifetime access to all content. You will also receive free access to all new examples.

A Magazine-Style Blog Listing Block

Blog Page is a listing block that arranges posts the way editorial sites do: a large hero for the newest article, a Featured Posts rail beside it, and a Recent Posts grid underneath with an All Posts button. It is one of two blocks in the blog pages category, covering the index side while its sibling covers the article view.

Drop it into company blogs, SaaS content hubs, documentation changelog feeds, or personal sites. Because it is a self-contained section with its own max-width container, it can live on a dedicated /blog route or be embedded further down a landing page.

The Featured Hero and Sidebar Combo

The hero takes the most recent post, renders its cover through next/image, and overlays a gradient scrim with a category Badge and the title in white. Beside it, a Card component lists other featured posts as compact rows with a thumbnail, a two-line clamped title, and a read-time label with a clock icon.

Selection logic is plain TypeScript: type guards split FeaturedBlogPost from RegularBlogPost, a shared sortByDateDesc helper orders both groups, and the newest post overall wins the hero slot. No CMS is assumed, so the logic ports cleanly to whatever data source you have.

Typed Post Data You Can Swap Out

All content lives in blog-posts.ts as a typed array with image URLs, author names, avatars, read times, and ISO publish dates. The components never hardcode a post, which means wiring a headless CMS or an MDX loader is a matter of mapping your records onto the BlogPost type and deleting the sample file.

Each grid entry is a BlogPostCard component: an aspect-video cover image, clamped title and description, and an author row using the Avatar component with initials as fallback. Cards are wrapped in links with a hover opacity transition, keeping the whole surface clickable.

Styling the Grid With Tailwind Utilities and Tokens

Layout is pure Tailwind: a three-column CSS grid at the top that gives the hero two columns, and a responsive one-to-three column grid for recent posts. Muted text uses text-muted-foreground and cards inherit bg-card, so the block obeys dark and light themes through the standard Shadcn UI CSS variables.

To retheme it, adjust tokens in globals.css rather than the markup. Radius, muted contrast, and card background changes propagate to every post card at once, and the hero scrim remains legible because it composes a black gradient over the image rather than a themed color.

Getting the Blog Listing Into Your Project

Since the block is free, nothing stands between you and the source: open the code tab, copy page.tsx with its two child components and the data file, and you are done. The header of the page also prints a shadcn CLI command with npm, pnpm, yarn, and bun switches that registers the block and its dependencies automatically.

React, Vuejs, and Svelte are all covered. The listing has been recreated with shadcn-vue for Vuejs apps and shadcn-svelte for Svelte apps, so the hero, sidebar, and card grid look identical regardless of the framework badge in your package.json.

Frequently Asked Questions

How does the block decide which article appears in the big hero?
It sorts every post by publishedAt descending and takes the first. Featured posts are filtered separately with a type guard and fill the sidebar list next to the hero.
What is the fastest way to plug in my CMS posts?
Replace the exported array in blog-posts.ts with a mapped result from your CMS that satisfies the BlogPost type. The hero, sidebar, and grid all derive from that single import.
Do the post cards handle missing author avatars?
Yes. The Avatar component falls back to the author's initials, computed from the name string, whenever the image fails or is absent.
Is there any charge for the blog listing code?
No. This example belongs to the free tier, so the full source and the CLI install line are open to every visitor without signing up.
Can Svelte or Vuejs teams use this listing without rewriting it?
Yes. Ready-made ports exist on shadcn-svelte and shadcn-vue, so both ecosystems get the same block as a native implementation instead of a manual conversion.