Hero, flanked picture


Install
npx shadcn add @klarhimmel/hero-flanked-mediaDetailsAbout, usage, props and more
A centred heading, then one picture in the middle with a button on each side of it. On a phone the second action, the picture and the main action stack in that order.
Import
Import
- hero/flanked-media
- Category
- The first screen: what it is, who it is for, what to do next. New project? Set it up once: /get-started/installation.
Notes
When to use it
A short statement with one picture in the middle and a button on each side of it, for a page with exactly two choices. For one action under a picture use hero-media-foot.
Writing for it
- Title up to 100 characters, one line. - Both buttons are short verbs: the left one the quieter choice, the right one the main action. - The picture is 4 by 3 at a middle width, so give it a real subject.
Watch out for
The side buttons only sit beside the picture on a wide screen. On a phone they stack in source order around it, so the quieter choice comes first; do not rely on the sides to explain which is which.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | 'Say in one line what the page offers' | Text, up to 100 characters. |
media | Media | {…} | See the type. |
secondary | Link | {…} | Optional; empty is not rendered. |
primary | Link | {…} | Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |