Heading
Render a semantic Astryx heading.
Astryx Props
JSON-safe Heading props forwarded to Astryx.
Supported Astryx props include:
level(1 or 2 or 3 or 4 or 5 or 6; required): Heading level. Determines the semantic HTML element (h1-h6) and the visual styling from the theme (unless 'type' is set).type('display-1' or 'display-2' or 'display-3'): Display type variant. Overrides the visual styling from 'level' with display-scale sizing (larger, lighter weight, tighter line-height). The 'level' still determines the HTML element for accessibility. Use for hero banners, marketing headlines, and data callouts.children(ReactNode; required): Heading content.accessibilityLevel(1 or 2 or 3 or 4 or 5 or 6): Accessibility level override. When set and different from 'level', applies 'aria-level' so the document outline differs from the visual style.color('primary' or 'secondary' or 'disabled' or 'placeholder' or 'accent' or 'inherit'): Text color.display('inline' or 'block'): Display type. Silently overridden to 'block' when maxLines0 or hasCapsize is true.
maxLines(number): Maximum lines before truncation. 0 means no truncation. When set, shows a tooltip on hover if content is truncated.hasTruncateTooltip(boolean or 'above' or 'below' or 'start' or 'end'): Controls tooltip behavior for truncated text. true shows the tooltip at the default position, false disables it, or a placement string ('above' or 'below' or 'start' or 'end') sets a specific position.wordBreak('break-word' or 'break-all'): Word break behavior when truncating. Defaults to 'break-all' for single-line truncation, 'break-word' otherwise.textWrap('wrap' or 'nowrap' or 'balance' or 'pretty'): Text wrapping behavior.justify('start' or 'center' or 'end'): Text alignment (justification). Uses logical values (start/end) for i18n/RTL compatibility.hasCapsize(boolean): Enable optical alignment using text-box-trim. Forces block display.hasStrikethrough(boolean): Apply strikethrough text decoration.id(string): HTML id attribute.
Props typed as React nodes, render functions, event handlers, refs, or StyleX styles are documented for Astryx parity but cannot be serialized directly from Python unless the wrapper adapts them.
See Astryx component docs: https://astryx.atmeta.com/components/Heading.
Functions
constructor__init__(text, *, level=3, display_type=None, color=None, max_lines=None, text_wrap=None, justify=None, **props) -> NoneparamtextstrText content synchronized to the frontend component.
paramlevelint= 3Heading level from 1 through 6.
paramdisplay_typestr | None= NoneOptional Astryx display-scale type.
paramcolorstr | None= NoneTheme text color.
parammax_linesint | None= NoneMaximum rendered lines before truncation.
paramtext_wrapstr | None= NoneText wrapping behavior.
paramjustifystr | None= NoneLogical text alignment.
parampropsAny= {}Returns
None