Skip to content
Haze UI

Section heading

Heading group for a page section: an optional uppercase eyebrow, a large title and a muted description, left or centered.

pnpm dlx shadcn@latest add @haze/section-heading
Open preview in a new tab
Liveno JavaScript

When to use

  • Opening a landing-page section such as features, pricing or FAQ
  • A title with a one-line intro that needs the same type scale on every section
  • Pointing a <section aria-labelledby> at its heading through the id prop

When not to use

  • A heading inside a card or a dialog; those components take their own title prop
  • Body-size subheadings in running text; use a plain heading with prose classes

Installation

Add the Haze registry to components.json once, then install Section heading with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/section-heading
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
title*string–The heading text.
eyebrowstring–Short label above the title, drawn as a muted uppercase micro-label.
descriptionstring–Muted paragraph under the title, at most 42 rem wide.
align"left" | "center""left"Text alignment; center also centers the box and the description in the parent.
headingLevel1 | 2 | 32Tag of the title. Visual size stays the same at every level.
idstring–Set on the heading element, for aria-labelledby on the surrounding section.
classstring–Extra classes on the wrapper.

Accessibility

  • The title level is a prop, so the size you see is decoupled from the outline; a section under an h2 page title should use 3.
  • The eyebrow is a paragraph outside the heading, so screen reader heading lists show only the title.
  • Use headingLevel 1 once per page; the default 2 assumes the page already has its h1.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Section heading" with `npx shadcn@latest add @haze/section-heading`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import SectionHeading from "@/components/haze/ui/section-heading.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/section-heading.md

  • Customize with real content

    Adapt the Haze section-heading ui for our product. Replace the demo values of these props with our real content: title, eyebrow, description, align, headingLevel, id, class. Keep the layout, the heading level rules and these accessibility details: The title level is a prop, so the size you see is decoupled from the outline; a section under an h2 page title should use 3. The eyebrow is a paragraph outside the heading, so screen reader heading lists show only the title. Use headingLevel 1 once per page; the default 2 assumes the page already has its h1. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using section-heading, check it fits: use it when opening a landing-page section such as features, pricing or faq; a title with a one-line intro that needs the same type scale on every section; pointing a <section aria-labelledby> at its heading through the id prop. Avoid it when a heading inside a card or a dialog; those components take their own title prop; body-size subheadings in running text; use a plain heading with prose classes. Alternatives: @haze/card, @haze/separator.

Dependencies

  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog