Hero
Landing-page hero — a full-width banner, an inset card, or your preset's home hero.
A landing-page header. Without title it has two variants: the default
full-width banner, and a card that sits inset in the content with room for a
code sample. With title it's your preset's home hero — the top
of a docs home.
Default
A centred banner with a soft gradient. Set background="none" to drop the
gradient, which is useful when the page already has a custom background.
Card variant
| Attribute | Description |
|---|---|
title | The headline. Selects the home hero |
description | The lede under the headline |
install | A shell command with a copy button. Console, Plain, Orbit and Grid show it in their own install block. Workbench, Paper, Atlas and Margin have none, so it's a compact line inside the hero, above the search box |
eyebrow | The small label above the headline, in presets that draw one |
align | center (default) or left. See Starting the hero on the left |
Inside it:
<SearchBar> goes in the hero's
search slot, always as the home search box — an input readers type into,
with results as they type or a question for the assistant (see
Typing in the home search box);On Paper and Atlas, the hero's search box shows the <SearchBar>'s own
placeholder and suggestions. On Plain, a hero with both install and a
<SearchBar> draws the title and lede, then the Install code block, then a
Get help search box with the <SearchBar>'s placeholder and the
⌘K hint:
A page whose body opens with <Hero title> has no page head — no
breadcrumbs, <h1>, description or reading time — because the hero is the
head. That holds on any page, so the frontmatter title and description
stay for the browser tab, search and link previews and are not shown twice.
An index page that uses <Hero title> is the docs home as you wrote it —
see Home page. Pair it with
layout: wide for a home with no
sidebar.
Starting the hero on the left
By default the home hero keeps your preset's own alignment: Workbench, Console,
Atlas, Plain and Margin draw it in a column centred on the page, and Orbit
centres its text. With align="left" the eyebrow, headline, lede, buttons,
install line and search box start on the left instead:
layout: wide),
the hero lines up with the header's left edge, and the home components after
it (<SectionCards>, <LatestUpdates> and the others) line up with the
hero, so the page shares one left edge.align changes
nothing there.Any other value is ignored: the build warns and keeps the preset's own
alignment, and the editor flags it with center and left as the choices.
title, description, install and align are doc engine v2 only. A v1 site ignores
them and draws the banner.
Theming
On doc engine v1 the card draws from hero-card-bg and hero-card-fg, which
are separate tokens because the panel is an inverted surface and cannot be
derived from the page background. Doc engine v2 ignores those tokens and uses
the preset's card surface. Buttons use the accent tokens.