Heading

Alignment target:@astryxdesign/core v0.7.1 · Heading

Orders

<Heading
  :level="2"
>
  Orders
</Heading>

Props #

NameTypeDefaultDescription
levelHeadingLevel-Heading level (1–6). Determines the semantic element (h1–h6). A numeric string reads as its number; a missing level, or one outside 1–6, renders level 2 and warns in development.
typeHeadingType-Visual type variant that overrides the default level styling. Optional: display-1, display-2, display-3, body, large, label, supporting.
colorHeadingColor'primary'Text color. Optional: primary, secondary, accent, inherit.
weightHeadingWeight-Font weight override. Optional: regular, medium, semibold, bold.
displayHeadingDisplay'block'Display type: block or inline.
accessibilityLevel1 | 2 | 3 | 4 | 5 | 6-Outline level for assistive technology when it should differ from the visual level. The element stays h{level}.
textWrap'wrap' | 'nowrap' | 'balance' | 'pretty'-CSS text-wrap.
wordBreak'break-word' | 'break-all'break-all for one line, break-word for moreHow long unbroken strings break when truncating. Without truncation, a token longer than its line (a URL, an ID) wraps (overflow-wrap: break-word), so in ordinary flow the text does not make the page scroll sideways. Inside a flex row, give the flex child min-width: 0 so it can shrink. A container you style with overflow-wrap: anywhere does not reach this text; Astryx's own containers pass their wrap through.
justify'start' | 'center' | 'end''start'Text alignment. start and end follow the writing direction.
hasCapsizebooleanfalseTrims the leading above the cap height and below the baseline with text-box-trim, so glyphs sit flush with the box edges. Forces block layout.
hasStrikethroughbooleanfalseDraws a line through the text.
hasTruncateTooltipboolean | 'above' | 'below' | 'start' | 'end'truePuts the full text in a tooltip after truncation. false turns it off and skips the measurement. It stays closed when the text fits. The tooltip mounts on the first hover, tap or keyboard focus; until then the element has no tooltip layer and no aria-describedby.
maxLinesnumber0Maximum lines before truncation. 0 means no truncation.

Native attributes #

The root element is <h1> through <h6>.

The following are passed to the root element:

  • HTML attributes.
  • aria-* attributes. Your own aria-level wins over the one accessibilityLevel derives.
  • data-* attributes.
  • class.
  • style. When maxLines is above 1, its line clamp replaces any -webkit-line-clamp in style.