EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
Text·component·@astryxdesign/core

Heading

Semantic heading component that renders h1-h6 elements with themed styling, themed sizing via type scale tokens, and line-clamp truncation.

Open in Playground @astryxdesign/core/Text

Showcases and examples

4 documented examples

Heading

Heading API entry

Preview loads on approachPreview loads on approach
Exact source · heading-showcase
// Copyright (c) Meta Platforms, Inc. and affiliates.

'use client';

import {VStack} from '@astryxdesign/core/Layout';
import {Heading} from '@astryxdesign/core/Text';

export default function HeadingShowcase() {
  return (
    <VStack gap={2} hAlign="start">
      <Heading level={1}>Heading Level 1</Heading>
      <Heading level={2}>Heading Level 2</Heading>
      <Heading level={3}>Heading Level 3</Heading>
      <Heading level={4}>Heading Level 4</Heading>
      <Heading level={5}>Heading Level 5</Heading>
      <Heading level={6}>Heading Level 6</Heading>
    </VStack>
  );
}

Usage

Semantic heading component that renders h1-h6 elements with themed styling, themed sizing via type scale tokens, and line-clamp truncation.

Typed props

PropType and behavior
level1 | 2 | 3 | 4 | 5 | 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' | 'display-2' | 'display-3'
Display type variant. Overrides the visual styling from level with display-scale sizing (larger, lighter weight, tighter line-height). Themes may add custom visual types. The level still determines the HTML element for accessibility. Use for hero banners, marketing headlines, and data callouts.
weight'normal' | 'medium' | 'semibold' | 'bold'
Explicit font-weight override. Wins over the selected visual type or heading-level default.
childrenReactNode · required
Heading content.
accessibilityLevel1 | 2 | 3 | 4 | 5 | 6
Accessibility level override. When set and different from level, applies aria-level so the document outline differs from the visual style.
color'primary' | 'secondary' | 'disabled' | 'placeholder' | 'accent' | 'inherit' · default 'primary'
Text color. Themes may add custom colors.
display'inline' | 'block' · default 'block'
Display type. Silently overridden to 'block' when maxLines > 0 or hasCapsize is true.
maxLinesnumber · default 0
Maximum lines before truncation. 0 means no truncation. When set, shows a tooltip on hover if content is truncated.
hasTruncateTooltipboolean | 'above' | 'below' | 'start' | 'end' · default true
Controls tooltip behavior for truncated text. true shows the tooltip at the default position, false disables it, or a placement string ('above' | 'below' | 'start' | 'end') sets a specific position.
wordBreak'break-word' | 'break-all'
Word break behavior when truncating. Defaults to 'break-all' for single-line truncation, 'break-word' otherwise.
textWrap'wrap' | 'nowrap' | 'balance' | 'pretty'
Text wrapping behavior.
justify'start' | 'center' | 'end' · default 'start'
Text alignment (justification). Uses logical values (start/end) for i18n/RTL compatibility.
hasCapsizeboolean · default false
Enable optical alignment using text-box-trim. Forces block display.
hasStrikethroughboolean · default false
Apply strikethrough text decoration.
idstring
HTML id attribute.

Theming

Targets

astryx-heading

Visual props: level, color, type, weight