Server Component · 0 KB client JS

Heading

Semantic headings built on Text, with per-level size and weight defaults.

Heading h1

Heading h2

Heading h3

Heading h4

Heading h5
Heading h6

Import#

import { Heading } from "astralis-ui";

Usage#

as picks the heading level (h1–h6, default h2) and brings a matching default size (4xl → md) and weight (bold for h1–h3, semibold below). Heading also presets the heading font family, tight leading and tight tracking. Override any of it with the regular Text props.

Decoupling size from level#

Heading levels are for the document outline; size is for the design. Override size freely without breaking semantics or accessibility.

Visually huge

…but still an h2 in the document outline.

Props#

Heading accepts every Text prop except paragraph, plus:

PropTypeDefaultDescription
as"h1" | "h2" | "h3" | "h4" | "h5" | "h6""h2"Heading level; sets the default size and weight.
sizeText sizesper level`h1` → `4xl`, `h2` → `3xl`, `h3` → `2xl`, `h4` → `xl`, `h5` → `lg`, `h6` → `md`.
weightText weightsper levelBold for h1–h3, semibold for h4–h6.