Skip to content
Klarhimmel UI

Hero, url form

Hero, url form previewHero, url form preview

Install

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

A centred hero: a small pill badge, a large two-line heading, a line under it, then a label and one wide rounded input for a web address with a submit button.

Import

Import

import Block from '@/components/klarhimmel/blocks/hero-url-form';
Also called
  • hero/url-form
About
A centred hero: a small pill badge, a large two-line heading, a line under it, then a label and one wide rounded input for a web address with a submit button. On a phone the heading wraps to three lines and the input fills the width.
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 hero with a pill badge, a two-line heading and one wide input for a web address with a submit button. Choose it when the first step is to paste a site, and hero-prompt-box when it is free text.

Writing for it

- Write the label above the input as what the address is for, since it names the field for assistive tech as well. - The form submits a GET with the address as url to the action page. Leave the action out and it submits to the page it is on. - Keep the heading to two short lines. On a phone it wraps to three, so a long second line pushes the input down.

Watch out for

The submit is a native form post, so the receiving page must handle a missing or malformed address. The block does not validate that the text is a real site.

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 HeroUrlForm from '@/components/klarhimmel/blocks/hero-url-form';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <HeroUrlForm props={{
          "badge": "Name what is new or true now",
          "title": "Say what the visitor gets in two short lines",
          "description": "Say in one or two sentences why it matters to the visitor and what they do next.",
          "label": "Ask for the visitor's address",
          "submit": "Start"
        }} />
      </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
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.
badgestring'Name what is new or true now'Text, up to 40 characters.
titlestring'Say what the visitor gets in two sh…'Text, up to 80 characters.
descriptionstring'Say in one or two sentences why it …'Text, up to 200 characters.
labelstring'Ask for the visitor's address'Text, up to 40 characters.
submitstring'Start'Text, up to 24 characters.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.