Blocks
Magazine hero
An editorial hero with a very large headline beside a tall, offset visual and a corner badge.
Issue 04
Stories from
the coast
Essays, photographs and conversations from people shaping the Swahili coast.
- Essays
- Photography
- Food
New issue
Use MagazineHero for a bold, editorial first impression, such as a publication, a campaign or a portfolio. The headline scales with the screen, and the visual sits in a tall frame with a solid saffron block offset behind it.
Installation
pnpm dlx shadcn@latest add https://components.abdulqadirmsingi.com/r/magazine-hero.json
Usage
import { MagazineHero } from "@/components/ui/magazine-hero";
<MagazineHero
eyebrow="Issue 04"
title={<>Stories from<br />the coast</>}
tags={["Essays", "Photography"]}
badge="New issue"
caption="Photo: A. Photographer"
media={<img src="/cover.jpg" alt="A dhow at sunrise" className="size-full object-cover" />}
/>Props
It extends the native <section> props (except title) and spreads them onto the section, including ref (React 19). It is a Server Component: it has no state and needs no JavaScript.
| Prop | Type | Default | Description |
|---|---|---|---|
| eyebrow | ReactNode | – | A short line above the headline. |
| title | ReactNode | – | The headline. Required. |
| description | ReactNode | – | A short paragraph under the headline. |
| actions | ReactNode | – | Buttons or links shown under the text. |
| headingLevel | 1 | 2 | 1 | The heading level for the headline. |
| tags | string[] | – | Short labels shown as a list. |
| media | ReactNode | – | The visual, shown in a 4:5 frame. Required. |
| caption | ReactNode | – | A caption under the visual, such as a credit. |
| badge | ReactNode | – | A small pill overlapping a corner of the visual. |
Accessibility
- The section is a landmark named by its headline (
aria-labelledby). The headline is anh1by default; passheadingLevel={2}if the page already has one. - Text never sits on top of an image, so its contrast does not depend on the picture you choose.
- Give each image its own
alttext, oralt=""if it is purely decorative. - Make the buttons or links you pass as
actionsat least 24px tall (these examples use 44px).
Tokens used
--accent, --accent-foreground, --accent-ink, --primary, --primary-foreground, --control-border, --border, --muted.
Known limitations
- It lays out the content you give it; it does not choose or crop images for you. Use a ratio-friendly image, and
object-coveron it. - The demos use plain shapes as stand-in artwork. Bring your own pictures.