Hero, prompt


Install
npx shadcn add @klarhimmel/hero-promptDetailsAbout, usage, props and more
Centred headline with a prompt input as the call to action and suggestion chips. For AI products.
Import
Import
- hero/prompt
- 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
An opener built around an input: a prompt box, a site address field or a search, with suggestion chips below. It is for products where the visitor's first act is typing; for a plain pitch use hero-centered.
Writing for it
- Placeholder (120) and submit (20) are both required. Make the placeholder an example of a good answer, and set inputLabel (80) so the field has a proper accessible name. - Suggestions take up to five chips of 60 characters each; they should be real prompts a visitor could send as they are. - For a site address, set multiline to false and inputType to domain. The optional field adds a second labelled input under the prompt only when it has a label.
Watch out for
The sent and error states come from the status prop, which only the host can set; the block never decides on its own that a submit worked. Without action and method it does not submit natively.
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 |
|---|---|---|---|
eyebrow | string | 'Name what this is' | Text, up to 60 characters. |
title | string | 'Say what the visitor gets in one li…' | Text, up to 120 characters. |
description | string | 'Say in one or two sentences what it…' | Text, up to 300 characters. |
descriptionPlacement | 'under-title' | 'under-note' | - | One of 'under-title', 'under-note'. Optional; empty is not rendered. |
placeholder | string | 'Describe what you want, in a line…' | Text, up to 120 characters. |
submit | string | 'Send' | Text, up to 20 characters. |
suggestions | string[] | 3 items | List of up to 5. Optional; empty is not rendered. |
note | string | 'Say what makes starting easy.' | Text, up to 80 characters. |
inputName | string | - | Text, up to 40 characters. Optional; empty is not rendered. |
multiline | boolean | - | Optional; empty is not rendered. |
inputType | 'text' | 'url' | 'domain' | - | One of 'text', 'url', 'domain'. Optional; empty is not rendered. |
grow | boolean | - | Optional; empty is not rendered. |
inputLabel | string | - | Text, up to 80 characters. Optional; empty is not rendered. |
escape | Link | - | Optional; empty is not rendered. |
escapePlacement | 'inside' | 'below' | - | One of 'inside', 'below'. Optional; empty is not rendered. |
field | { label, name, placeholder, type, required, escape } | - | Fields: label (optional), name (optional), placeholder (optional), type ('text' | 'url' | 'domain') (optional), required (optional), escape (optional). Optional; empty is not rendered. |
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. |
status | 'idle' | 'sent' | 'error' | - | One of 'idle', 'sent', 'error'. Optional; empty is not rendered. |
messages | { sent, error } | {…} | Fields: sent, error. Optional; empty is not rendered. |
errors | { required, email, url, domain } | - | Fields: required (optional), email (optional), url (optional), domain (optional). Optional; empty is not rendered. |
bare | boolean | - | Optional; empty is not rendered. |
attach | { label, accept, name, multiple } | - | Fields: label (optional), accept (optional), name (optional), multiple (optional). Optional; empty is not rendered. |
tools | { label, icon, kind, name, href }[] | - | List of up to 2. Each item: label, icon ('globe' | 'bot' | 'sparkles' | 'image' | 'link') (optional), kind ('toggle' | 'link'), name (optional), href (optional). Optional; empty is not rendered. |
height | 'auto' | 'screen' | - | One of 'auto', 'screen'. Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |