0.1.0-rc.2

Heading

Heading groups an eyebrow, title, and description into a page or section header with consistent typographic rhythm.

Try it

Components

Button

Trigger actions with clear, accessible labels.

Usage

Compose with RuiHeadingEyebrow, RuiHeadingTitle, and RuiHeadingDescription. Adjust size and align for the layout context.

import {
  RuiHeading,
  RuiHeadingEyebrow,
  RuiHeadingTitle,
  RuiHeadingDescription,
} from '@ecopages/radiant-ui/heading';
 
<RuiHeading size="lg" align="start">
  <RuiHeadingEyebrow>Components</RuiHeadingEyebrow>
  <RuiHeadingTitle>Button</RuiHeadingTitle>
  <RuiHeadingDescription>Trigger actions with clear, accessible labels.</RuiHeadingDescription>
</RuiHeading>

Semantic wrapper

Set as to header or section when the heading block defines a landmark region on the page.

Theming

Heading text maps to the on-background role, never a palette step:

PartCSS roles
Rooton-background text
Eyebrow / title / descriptionon-background; sizes come from --text-* + --heading-* scale variables
Alignment--heading-* spacing tokens per size

Type scales are set via CSS custom properties (--heading-title-font-size, --heading-description-gap, …) so the block can be re-themed at the theme layer. Override colors at the theme layer, not in component CSS.

Accessibility

  • RuiHeadingTitle renders the appropriate heading level for the page outline.
  • Do not skip heading levels between the title and surrounding content.
  • Eyebrow text is supplementary, the title carries the primary meaning.

API

RuiHeading and its parts are presentational JSX views, no custom element. RuiHeadingTitle renders RuiHeadline sized by the parent block's CSS variables.

Props

ComponentPropTypeDefaultDescription
RuiHeadingasdiv · header · section · article · asidedivRoot element.
alignstart · centerstartText and flex alignment.
sizesm · md · lg · xlmdType scale and vertical rhythm.
RuiHeadingTitleash1h6 · p · spanh2Heading level.
idstringElement id.

CSS classes

Public BEM classes (documented via @cssclass):

ClassDescription
.rui-heading · --align-start · --align-center · --size-sm · --size-md · --size-lg · --size-xlRoot + layout/scale variants.
.rui-heading__eyebrowKicker line above the title.
.rui-heading__titleMain title.
.rui-heading__descriptionSupporting copy.

Theme roles

PartCSS variables consumed
Text--on-background
Type scale--text-xs--text-4xl, --leading-compact, --heading-*