Skip to content
Klarhimmel UI

Hero, actions first

Hero, actions first previewHero, actions first preview

Install

npx shadcn add @klarhimmel/hero-actions-first
DetailsAbout, usage, props and more

A strip across the top with the buttons on the left and a plain link on the right, then a large centred heading with its lead, and a wide picture with a caption under it.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-actions-first';
Also called
  • hero/actions-first
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 page that opens on its buttons: a strip across the top holds the actions, then a large centred heading with its lead and a wide picture. Pick hero-centered when the buttons belong under the heading instead.

Writing for it

- Title up to 100 characters; it draws very large, so keep it to a short line. - Description up to 200 characters, one or two lines. - The plain link at the right of the strip is optional; leave its label empty to draw nothing.

Watch out for

The buttons come before the heading, so a visitor meets the action first; use it only when the action is the point of the page. The strip runs the full width of the section and keeps its own surface colour, so it reads as a bar, not a card.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import HeroActionsFirst from '@/components/klarhimmel/blocks/hero-actions-first';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroActionsFirst props={{
          "primary": {
            "label": "Main action",
            "href": "#start"
          },
          "secondary": {
            "label": "Second action",
            "href": "#more"
          },
          "more": {
            "label": "A plain link",
            "href": "#about"
          },
          "eyebrow": "Name the topic in a few words",
          "title": "Say in one line the main idea of the page",
          "description": "Say what the page offers and who it suits, in one or two short lines.",
          "media": {
            "src": "/pictures/photo-camp1.avif",
            "alt": "Tents pitched on grass above a lake"
          },
          "caption": ""
        }} />
      </BlockSurface>
    </Theme>
  );
}

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.

PropTypeDefaultDescription
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
moreLink{…}Optional; empty is not rendered.
eyebrowstring'Name the topic in a few words'Text, up to 40 characters.
titlestring'Say in one line the main idea of th…'Text, up to 100 characters.
descriptionstring'Say what the page offers and who it…'Text, up to 200 characters.
mediaMedia{…}See the type.
captionstring''Text, up to 120 characters.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.