Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Large Preview Blog Block for React

One long read at poster size: a wide drawn cover in a frame and a raised panel with the title, the dek and a byline whose author link opens a hover card.

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 large post preview for React with Base UI, written for Broadsheet North, a regional paper's long reads. Under a centred header, one post is shown at poster size: a wide drawn cover in a hairline frame with + marks on its corners, the headline's first three words set in huge type over a masthead and columns of grey text, and under it one raised panel with the category, the title, the dek and a byline. The whole post is one link, its title. The author's initials and name are a second link above it, with a hover card that shows a bio, a post count and the latest title; it opens on hover and on keyboard focus, and the same facts are a visible line on touch screens. The cover is drawn in your theme's tokens, never a photo. It's built from Guides, Badge, Avatar and Hover Card. For long reads, features and any page that wants one story at full size.

FAQ

How do I change the post and the author?

Edit POST and AUTHOR at the top of the file. POST has the title, the dek, an ISO date, the reading time, the category and the display words the cover sets in huge type (the title's first three words). AUTHOR has the name, a role, a bio, a post count and the latest title, which the hover card and the touch line both show. The date is fixed and formatted in UTC.

Can a keyboard or a phone reach the hover card?

A keyboard can: tabbing to the author link opens the card, and Escape closes it. (React Aria's card also closes when the page scrolls, as when focus scrolls a link into view.) A touch screen can't hover, so the same facts are a visible line under the byline there ([@media(hover:none)]); everywhere else that line is hidden from view but is the link's description for a screen reader. The card is never the only place the facts appear. Base UI's preview card opens on hover and on focus; the delay is set on the trigger.

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

It's set in container units: a masthead row, the headline's first words at about 17% of the cover's width, a rule and three columns of grey lines, all in theme tokens. It is 4:3 on a phone and 16:9 from sm. To use a photo, put an img with object-cover and size-full inside PostCover; the frame keeps its ring and radius.

How does it fit on a phone?

The cover is 4:3, the panel follows, and the byline wraps: the author link first, then the date and the reading time. The block is about one and a half screens and nothing scrolls sideways at 320 pixels.

Does it work right to left?

Yes. The panel's text aligns to the start, the byline mirrors and the hover card opens under the link. The date, the reading time and the post count are isolated with bdi. The cover is artwork and never mirrors, as a photo wouldn't.

  • Pro

    Featured Post Blog

    Featured story

    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.

  • 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

    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

    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

    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.