Skip to content

Heading

The Heading component provides a consistent and flexible way to render typographic titles across the design system.
It supports different heading levels (h1h6) or custom tags, while maintaining a unified visual style.

✨ Features

  • Supports HTML heading levels: h1 to h6
  • Can render any HTML tag via the as prop (div, span, etc.)
  • Automatically applies the corresponding typography style based on the level
  • Works with both light and dark themes
  • Fully compatible with RTL layouts

🚀 Usage

Basic Example

vue
<template>
  <Heading level="1">Main Title</Heading>
  <Heading level="2">Section Title</Heading>
  <Heading level="3">Subsection Title</Heading>
</template>

API

Props

PropTypeDefaultDescription
level1 | 2 | 3 | 4 | 5 | 61Defines the visual and semantic level of the heading.
asstringOptional HTML tag to render instead of the default (h1h6). Useful for styling without breaking semantics.
classstringAdditional custom classes.

Styling

LevelClassExample Font SizeFont Weight
h1.heading--h12.25rem700
h2.heading--h21.875rem600
h3.heading--h31.5rem600
h4.heading--h41.25rem500
h5.heading--h51.125rem500
h6.heading--h61rem500

Custom Tag Example

You can render a heading visually like an h2 but semantically as a div:

vue
<Heading as="div" level="2">Visually h2, but semantically a div</Heading>

Accessibility

Headings are essential for screen readers and SEO. Ensure the hierarchy reflects the logical structure of your page content.

Publié sous licence MIT.