Skip to main content

atoms

Heading

A semantic h1 to h6 chosen by level, so a caller keeps the document outline correct while styling the text.

Specimens

Section heading

Selected work

{{ Heading.render({
  level: 2,
  text: "Selected work",
  classes: "font-display text-4xl text-neutral-100"
}) }}
Subheading A level outside 1 to 6 falls back to 2.

Recent projects

{{ Heading.render({
  level: 3,
  text: "Recent projects",
  id: "spec-heading-3",
  classes: "font-display text-xl text-neutral-300"
}) }}

Params

ParamTypeDescription
levelnumberHeading level, 1 to 6. Values outside that range render h2. Defaults to 2.
textstringHeading text.
idstringOptional id on the heading.
classesstring, variant map, or arrayApplied to the heading through classes.