Skip to content
Klarhimmel UI

Hero, install command

Hero, install command previewHero, install command preview

Install

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

Centered headline with a copyable install command and two links. For developer tools and libraries.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-code';
Also called
  • hero/install
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 centred opener for developer tools, where the first thing the reader does is copy an install command. For a product with a screenshot to show, hero-frame or hero-split fit better.

Writing for it

- The command holds 120 characters and is shown in a copyable block, so write it as one runnable line without a prompt symbol. - Use primary for the docs and secondary for browsing examples. The secondary renders as a ghost link, so it will look quieter than the primary button. - The eyebrow (60) is a good place to state the licence or kind of project, such as open source toolkit.

Watch out for

The command sits at a fixed narrow width. A long line with flags or a full URL will scroll or wrap inside the block rather than widening it, so keep it near 40 characters.

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 HeroCode from '@/components/klarhimmel/blocks/hero-code';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroCode props={{
          "eyebrow": "Name what this is",
          "title": "Say what the visitor gets in one line",
          "description": "Say in one or two sentences what it does, who it is for and what the visitor can do next, in plain words.",
          "command": "npm create your-app@latest",
          "primary": {
            "label": "Main action",
            "href": "#docs"
          },
          "secondary": {
            "label": "Second action",
            "href": "#components"
          }
        }} />
      </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
eyebrowstring'Name what this is'Text, up to 60 characters.
titlestring'Say what the visitor gets in one li…'Text, up to 120 characters.
descriptionstring'Say in one or two sentences what it…'Text, up to 300 characters.
commandstring'npm create your-app@latest'Text, up to 120 characters.
primaryLink{…}Optional; empty is not rendered.
secondaryLink{…}Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.