shadcn.io is not affiliated with official shadcn/ui
Cover Story Blog Block for React
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.
Installation
Overview
A cover-story section for React with Base UI, written for Gatefold Quarterly, an architecture magazine. The current issue's cover is drawn in greyscale as a portrait figure in a hairline frame: a masthead, the issue number, a drawing of arches, one cover line and a barcode. Behind a divider sit the story's category, title, dek and byline, a Shine Button that reads "Read the cover story", and "Inside this issue", an ordered list of five pieces with leader dots and page numbers. The cover is built from CSS and one SVG in your theme's tokens and is hidden from assistive technology, never a photo. On a phone a smaller cover sits above the copy. It's built from Guides, Badge, Avatar, Button and Shine Button. For magazines, annual reports and any publication that sells one issue at a time.
FAQ
How do I change the issue, the story and the contents?
Edit ISSUE, STORY and INSIDE at the top of the file. INSIDE is a list of pieces with a title, a page number and an href; the numbers are shown in a tabular face with a hidden "Page" for screen readers, and the leader dots are a dotted rule that fills the space between a title and its page. STORY has the title, the dek, the author, an ISO date and the reading time; the cover repeats the title and the season.
How is the cover drawn, and how do I use a real one?
MagazineCover is set in container units, so it reads the same at any width: the masthead, a rule with the issue number, an SVG of five arches in three foreground weights, the cover line, and a barcode built from bar widths. Every colour is a theme token. To show a scan or a photo instead, put an img with object-cover and size-full inside the same figure; keep it aria-hidden and let the headline and the Read the cover story button carry the meaning.
Why is the copy first in the DOM when the cover is at the start?
Reading order follows the DOM, and the story matters more than its picture, so the copy comes first and the cover is placed at the start with grid columns from lg. On a phone the cover is placed above the copy for the same reason a magazine opens on its cover. Because the cover is hidden from assistive technology, nothing is read out of order.
How does it fit on a phone?
The cover shrinks to about 60% of the width in its frame, the copy follows under a drawn rule, and the contents list sits last, so the block is about two screens. The Shine Button is on the first screen. Nothing scrolls sideways at 320 pixels.
Related
- Pro
Featured Post Blog
Featured storyOne 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
Hero Featured Blog
Featured storyA 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
Large Preview Blog
Featured storyOne 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.
- Pro
Announcement Blog
Featured storyA 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.
- Pro
Cards Grid Blog
Card gridsThe 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
Rectangular Cards Blog
Card gridsFour 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.