Titlecomponent

Title({ level = "1", children, ...props }: TitleProps): ReactElement
ParamType
propsTitleProps
Props for Title — identical to HeadingProps. required
Return
ReactElement
Rendered <h1> heading element.

Page title — renders an <h1>.

  • The most prominent heading on a page; there should normally be exactly one.

The top-level page heading — renders an <h1>. It is the most prominent member of the three-level heading family: Title (<h1>), <Heading> (<h2>), <Subheading> (<h3>). There should normally be exactly one Title per page.

Things to know:

  • Pick the component that matches the level rather than overriding level. Choosing Title / <Heading> / <Subheading> keeps the visual size and the document outline in step.
  • The level prop (16) is an escape hatch for the rare case where the outline level must differ from the visual size — avoid it in normal use.
  • Inherits text colour by default so it picks up the surrounding tint; accepts color= and the typography variants.
  • Inside <Prose> a raw <h1> is styled by the same rules, so Markdown-rendered titles match component ones.

Usage

Page title

tsx
import { Title, Paragraph } from "shelving/ui";

<Title>Account</Title>
<Paragraph>Manage your profile and settings.</Paragraph>

Inside a panel header

tsx
import { Panel, Block, Title } from "shelving/ui";

<Panel as="header" color="primary">
  <Block width="narrow">
    <Title>Welcome</Title>
  </Block>
</Panel>

Styling

Title exposes hooks for its rhythm and type. It inherits text colour by default; set --title-color only to override that.

VariableStylesDefault
--title-tintTint anchor for the title scopeinherit (flows from color= / parent)
--title-colorText colourinherit
--title-space-beforeTop marginvar(--space-section) (2rem)
--title-spaceBottom marginvar(--space-paragraph) (16px)
--title-fontFont familyvar(--font-title)
--title-weightFont weightvar(--weight-strong) (700)
--title-sizeFont sizevar(--size-xxxlarge)
--title-leadingLine heightvar(--leading)

Global tokens it reads: --space-section, --space-paragraph, --font-title, --weight-strong, --size-xxxlarge, and --leading.

Examples

<Title>Welcome</Title>