Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Featured Post Blog Block for React

One lead post as a split, its copy beside a drawn greyscale cover behind a divider, with three more posts as cells on shared hairlines under it.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A featured-post section for React with Base UI, written for the Birchfield Journal, a gardening magazine. A compact header with an outline All stories link sits over the lead story: its copy at the start (category, title, dek, byline) and, at the end behind a divider, a drawn plan view of the raised bed it tells about. Three more posts follow as cells that share their hairlines, run from rail to rail and end the block, so the next section's top rule closes them. The cover is greyscale line art in your theme's tokens, never a photo, and the whole lead is one link. On a phone the cover heads the lead and the three cells become rows. It's built from Guides, Badge, Avatar and Button, with CSS for the entrance and the hover. For magazines, journals and any page that leads with one story.

FAQ

How do I change the lead and the three posts?

Edit LEAD and MORE at the top of the file. A post has a title, an author, a category, a date as an ISO string ("2026-09-12"), a reading time in minutes and an href; the lead also has a one-line dek. Dates are fixed, never computed from today, and are formatted in UTC so the server and the browser print the same day. Any number of cells works: each one draws its own hairlines, and the grid is three across from sm.

How is the cover drawn, and how do I use a photo?

BedCover is one SVG at module scope: graph paper, the bed's boards, four sections with five plants each (path strings built from a few numbers), a dimension line and a caption. Every colour is a theme token, so it follows light and dark and any preset, and every stroke stays a hairline at any size. To use a photo instead, put an img with object-cover and size-full inside PostCover: the frame keeps its 4:3 shape, ring and radius.

How does it fit on a phone?

The cover comes first and the copy follows under a drawn rule, then the three posts become rows, so the whole block is about two screens. From lg the lead is a split with the cover at the end behind a divider whose + mark meets the top rule. The cells stay stacked below sm and sit three across from sm. Nothing scrolls sideways at 320 pixels.

Does it work right to left?

Yes. The split, the divider and the cells mirror, and the arrows turn. The date and the reading time are isolated with bdi, so "11 min read" keeps its order. The cover is artwork and never mirrors, as a photo wouldn't.

  • Pro

    Cards Grid Blog

    Card grids

    The six latest posts of an engineering blog as cards on shared hairlines: drawn greyscale covers, a category, the title as the card's one link, a one-line dek and a byline with the date and reading time.

  • Pro

    Hero Featured Blog

    Featured story

    A blog landing: the lead story as a framed drawn cover with its copy on a raised panel overlapping the cover's corner, and a numbered rail of the four latest posts beside it.

  • Pro

    Cover Story Blog

    Featured story

    A printed magazine cover drawn in greyscale beside the cover story's copy, a Shine Button and an ordered list of the issue's pieces with leader dots and page numbers.

  • Pro

    Latest Posts Blog

    Featured story

    Just published: the newest post as a lead band in large type with a pulsing dot and a New mark, three earlier posts as rows with unread dots, and a Mark all as read button.

  • Pro

    Four horizontal post cards in rows from rail to rail, the drawn cover at one end and the text at the other, mirroring row by row, each row numbered.

  • Pro

    Announcement Blog

    Featured story

    A notice board: the lead announcement as a split with a framed card-in-card panel and a Shine Button, and the past announcements as a description list band.