Skip to content

Hero

The first screen of a landing page in five layouts. Plain by default: a headline, one line of support and your actions. The eyebrow, facts, command chip and background are opt-in. Centered is Free; Split, Product shot and Statement are Pro variants that build on it.

On this page
Used for
  • Landing page opener
  • Product launch headline
  • Install command promo
  • Changelog announcement
  • Docs home banner

Examples

Background

Left-aligned with factsFree

Split with mediaProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Product shotProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

StatementProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Statement, centredProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Statement, text onlyProPro

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Installation

npx knowns-ui@latest add hero
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.
title / lead
ReactNode
The headline (48 / 56 / 64px) and one or two sentences under it.
primary / secondary
{ label, href?, onClick?, external? }
A primary button and a quiet text link with an arrow.
eyebrow
{ label, href?, badge? }
Opt-in line above the headline. badge is one word in the accent colour, e.g. New.
proof
{ value, label, avatars? } | null
Opt-in: one small line right under the actions, a real count and what it counts. Pass null until the number is worth showing: nothing renders and no space is kept.
proof.avatars
string[]
Image URLs for 4 or 5 overlapping faces before the number. Decoration only: hidden from screen readers, no names, no hover, no +N (the number already says it).
facts
{ value, label }[]
Opt-in: up to 4 short facts under a hairline.
command
string
Opt-in: an install command in a chip with a Copy button. A leading $ is not copied.
rotate
string[]
Opt-in: words that rotate at the end of the headline. Their width is reserved, so the line does not jump.
as
"h1" | "h2" | "h3"
Default"h1"
Heading level of the headline. A page has one h1; use h2 when the hero is a demo or not the first section.
background
ReactNode
Opt-in: one of our Backgrounds behind the section. Plain by default.
align
"center" | "start"
Default"center"
HeroCentered: centred, or left-aligned.
media
ReactNode | MediaFrameProps
HeroSplit and HeroProduct: live content, or { src, srcDark?, alt, aspect?, video?: { src, poster } } in a fixed-aspect frame. Images load lazily; a video loads on Play.
mediaSide / footnote
"left" | "right" / ReactNode
Default"right"
HeroSplit: the side of the media from 1024px, and small print under the actions.
tilt / glow / aspect
number / string / string
Default10 / - / "16/10"
HeroProduct: degrees of tilt before the shot scrolls flat (0 or reduced motion keeps it flat), an opt-in glow colour, and the frame's aspect.
bleed
boolean
Defaulttrue
HeroProduct: the frame runs to the bottom edge of the section and is cropped there. false puts padding below it.
children
ReactNode
HeroCentered: anything under the actions, such as a screenshot or a Logo Cloud. HeroStatement: under the strip.
align
"start" | "center"
Default"start"
HeroStatement: where the text, buttons and install line sit. Start-aligned, the strip runs off the right edge; centred, it shows three cards in the column.
strip
"on" | "off"
Default"on"
HeroStatement: a row of real components (a thinking step, an approval, a context window, an uptime bar) under the text. They tell one story and hold still. off keeps the text block alone.
cards
{ id, label?, node, bare? }[]
HeroStatement: your own components for the strip. bare skips the card frame for components that bring their own.

Use one hero per page: it holds the page's only h1. Frames keep their size before media loads, so nothing shifts. Pick the layout by what you can show: no screenshot, use Centered or Statement; one strong screenshot, use Product shot; a short loop or a form, use Split.

What it handles

  1. 01Centres the headline, lead and actions, or left-aligns them with align="start", and sizes the headline at 48, 56 and 64px across the breakpoints.
  2. 02Adds the pieces only when you give them: an eyebrow with a badge word and optional link, up to four facts under the actions, and a figure above the eyebrow.
  3. 03Shows the first word of `rotate` still, and cycles through the list only when you set `rotateAuto`, because a headline that keeps changing is read less.
  4. 04Renders `command` in a chip with a Copy button that writes to the clipboard, calls `onCommandCopy` and reads Copied for about a second and a half.
  5. 05Types through `commandCycle` names one character at a time, pauses on hover, focus and a hidden tab, and shows one static command to the server and to reduced motion.
  6. 06Sets the vertical padding with `spacing` (default, tight or snug) and lays a Backdrop slot behind everything for one of the Backgrounds.

States

First render
Nothing. The headline, command and facts paint as they are
none
Hover the eyebrow link
The arrow turns from muted to full colour
120ms, ease out
Hover the secondary action
The arrow turns from muted to full colour
120ms, ease out
Hover the copy button
Background and colour change
120ms, ease out
Command copied
The copy icon swaps for a check that pops in
180ms, ease out
Reduced motion
The check shows without the pop; the typing command and rotating word stay still
0ms

Works with

When to use

When to use

  • The first screen of a landing page: one headline, a line of support and the main call to action.
  • Product launches that show the app itself: a large framed shot or a live demo under the headline.

When not to use

  • The title row of an app screen: use Page Header.
  • Second and later sections on a page: use one hero, then section blocks: use Feature Split.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Hero to my app and wire it to my own data.
  • I need the first screen of a landing page: one headline, a line of support and the main call to action. Set that up with the Knowns UI Hero.
  • Which Hero props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "hero" }) and search_docs({ query: "hero" }).

Need help?

Stuck on Hero, or found something off? We read every message.