Blocks
Split hero
A hero with text on one side and a visual on the other, stacking on narrow screens.
Applications open
Learn skills that build a career
Short, practical courses taught by people who do the work, with a mentor beside you from the first day.
- 1,200
- Students
- 24
- Courses
- 9 in 10
- Placement
Use SplitHero at the top of a landing page or a product page when you have one strong picture or illustration. The text and the visual sit side by side on large screens and stack on small ones, with the text first.
Installation
pnpm dlx shadcn@latest add https://components.abdulqadirmsingi.com/r/split-hero.json
Usage
import { SplitHero } from "@/components/ui/split-hero";
<SplitHero
eyebrow="Applications open"
title="Learn skills that build a career"
description="Short, practical courses."
actions={<a href="/apply">Apply now</a>}
highlights={[{ label: "Students", value: "1,200" }]}
media={<img src="/classroom.jpg" alt="Students in a workshop" className="size-full object-cover" />}
/>Media on the other side
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. |
| highlights | { label: string; value: string }[] | – | Short facts shown under the actions as a definition list. |
| media | ReactNode | – | The image or illustration. Required. |
| mediaPosition | "start" | "end" | "end" | Which side the media is on. It flips in right-to-left layouts. |
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
--background, --foreground, --muted-foreground, --border, --accent-ink.
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.