Hero, url form


Install
npx shadcn add https://ui.klarhimmel.com/r/hero-url-form.jsonDetailsAbout, 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
- 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.
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 |
|---|---|---|---|
action | string | - | 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. |
captcha | boolean | - | Optional; empty is not rendered. |
captchaSitekey | string | - | Text, up to 100 characters. Optional; empty is not rendered. |
badge | string | 'Name what is new or true now' | Text, up to 40 characters. |
title | string | 'Say what the visitor gets in two sh…' | Text, up to 80 characters. |
description | string | 'Say in one or two sentences why it …' | Text, up to 200 characters. |
label | string | 'Ask for the visitor's address' | Text, up to 40 characters. |
submit | string | 'Start' | Text, up to 24 characters. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |