shadcn.io is not affiliated with official shadcn/ui
Breadcrumb Post Header Block for React
An essay's header with a breadcrumb trail whose collapsed middle opens a menu of the parents it hides, the title, a dek and a byline band with the author, date and reading time.
Installation
Overview
The header of a single essay for React with Base UI, written for Longshore, an essay journal about coastlines. A breadcrumb trail sits over the title: Journal, a collapsed middle, Long-form, and the post itself. The ellipsis in the middle is a button that opens a menu of the two parents it hides, so the path never wraps and every parent stays one choice away; the current page is plain text that is cut short with an ellipsis when the line is full. Under the title and a one-sentence dek, a byline band on its own hairline holds the author's initials, the fixed publication date, the reading time and the category. It follows your theme and draws only type and rules, so it sits above any article body. It's built from Breadcrumb, DropdownMenu, Avatar, Badge, Button and Guides, with CSS for the entrance.
FAQ
How do I change the trail?
Edit ROOT, HIDDEN and SECTION at the top of the file, and the POST object for the title, dek, author, date and reading time. HIDDEN is the list of parents the ellipsis folds away, outermost first; the menu and its accessible name ("Show Essays and Coastlines") are built from it. The trail is a navigation landmark labelled Breadcrumb, and the current page is not a link.
How does the collapsed middle work?
The ellipsis is a ghost icon button with a name that lists what it hides. It opens a menu of links, one per hidden parent, and Escape closes it and returns focus to the button. The middle stays collapsed at every width, which keeps the line short on a phone and quiet on a desktop. To show every parent on wide screens, render the hidden links as breadcrumb items from md and keep the menu for smaller screens, as the breadcrumb banner does.
What happens to a long title in the trail?
The last crumb is the only one that shrinks: it truncates with an ellipsis, while the title in full is the heading right under the trail. Nothing wraps and nothing scrolls sideways, down to a 320 pixel screen.
Are the date and the reading time live?
No. The date is fixed text in the data, written as an ISO string and formatted in UTC so the server and the browser print the same day, and the reading time is a number you set. Nothing is computed from today.
Related
- Pro
Breadcrumb Top Bar Banner
Utility barsA 44-pixel top bar for a documentation site: a home icon and a real breadcrumb trail, whose middle crumbs fold into an ellipsis menu below the md breakpoint.
- Pro
Scrolling Article Table of Contents Blog
Article partsA framed, fixed-height essay with six sections beside a rail that follows the section in view with a sliding bar, and a Jump to select on phones; choosing a section scrolls the essay, never the page.
- Pro
Post Footer Blog
Article partsThe end of an article: tags as links, a share cluster whose Copy link really copies, an author panel beside Published and Updated dates, and Previous and Next as two cells on a shared hairline with arrow key hints.
- Pro
Author Profile Blog
Authors and staffOne writer's profile in a split: a large initials avatar, name and role, a bio, icon links with tooltips, a Follow toggle that reads Following, three figures from her posts, and her four newest posts as a list.
- 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.
- 3Pro
Series Tracker Blog
Tutorials and seriesA reader's place in a six-part series: the catalog's vertical Steps with a tick for each part read, the current part's panel with a typographic cover, a thin progress bar and a Shine Button that continues to the next part.