Skip to content
Klarhimmel UI

Hero, prompt box

Hero, prompt box previewHero, prompt box preview

Install

npx shadcn add https://ui.klarhimmel.com/r/hero-prompt-box.json
DetailsAbout, usage, props and more

A large dark prompt box with a round send arrow, a row of suggestion chips under it, then a filled button beside a plain link; the two actions stack on a phone.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-prompt-box';
Also called
  • hero/prompt-box
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 large dark prompt box with a round send arrow, suggestion chips under it, and a filled button beside a plain link. Use it when the product starts from something the visitor types, and hero-url-form when it starts from an address.

Writing for it

- Set the box's placeholder as an example of a good request, since it is what the visitor sees before typing. - Write the chips as real starting points a visitor can pick, three to five of them, in the same voice as the box. - Point the form action at the page that handles the text, and the form submits natively with its method.

Watch out for

The title is optional here and an emptied one draws no heading, so a page that needs a heading for its outline must keep it. The two actions stack on a phone.

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 HeroPromptBox from '@/components/klarhimmel/blocks/hero-prompt-box';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroPromptBox props={{
          "title": "Say what the visitor can make here, in one short line",
          "placeholder": "Ask the visitor the one question they come here to answer",
          "submit": "Send",
          "chips": [
            {
              "label": "First example"
            },
            {
              "label": "Second example"
            },
            {
              "label": "Third example"
            },
            {
              "label": "Fourth example"
            }
          ],
          "primary": {
            "label": "Start for free",
            "href": "#start"
          },
          "secondary": {
            "label": "Learn more",
            "href": "#more"
          }
        }} />
      </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
titlestring'Say what the visitor can make here,…'Text, up to 80 characters.
placeholderstring'Ask the visitor the one question th…'Text, up to 80 characters.
submitstring'Send'Text, up to 24 characters.
chips{ label }[]4 itemsList of up to 6. Each item: label.
primaryLink{…}See the type.
secondaryLink{…}Optional; empty is not rendered.
actionstring-Text, up to 300 characters. Optional; empty is not rendered.
method'post' | 'get'-One of 'post', 'get'. Optional; empty is not rendered.
hidden{ }-Optional; empty is not rendered.
captchaboolean-Optional; empty is not rendered.
captchaSitekeystring-Text, up to 100 characters. Optional; empty is not rendered.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.