Heading
Alignment target:@astryxdesign/core v0.7.1 · Heading
Orders
<Heading
:level="2"
>
Orders
</Heading>Props #
| Name | Type | Default | Description |
|---|---|---|---|
level | HeadingLevel | - | 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. |
type | HeadingType | - | Visual type variant that overrides the default level styling. Optional: display-1, display-2, display-3, body, large, label, supporting. |
color | HeadingColor | 'primary' | Text color. Optional: primary, secondary, accent, inherit. |
weight | HeadingWeight | - | Font weight override. Optional: regular, medium, semibold, bold. |
display | HeadingDisplay | 'block' | Display type: block or inline. |
accessibilityLevel | 1 | 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 more | How 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. |
hasCapsize | boolean | false | Trims 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. |
hasStrikethrough | boolean | false | Draws a line through the text. |
hasTruncateTooltip | boolean | 'above' | 'below' | 'start' | 'end' | true | Puts 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. |
maxLines | number | 0 | Maximum 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 ownaria-levelwins over the oneaccessibilityLevelderives.data-*attributes.class.style. WhenmaxLinesis above 1, its line clamp replaces any-webkit-line-clampinstyle.