DXC Logo
Halstack Design System
v16.1.0

Heading

A component used to establish clear content hierarchy and structure, ensuring both visual and semantic clarity across interfaces.

Introduction

The heading component provides consistent typographic structure for titles and section headers within the UI. It enforces semantic hierarchy through HTML tags (h1 through h6), supports visual distinction via styles and weights, and plays a key role in SEO and accessibility. The component is flexible in use, allowing control over styling and structure without breaking the logical order of information.

Variants

The Open Sans typeface has 5 different weights, from light to extra-bold but Halstack use three variations, light, regular and bold (default). The font size goes from 40 pixels for the h1 heading to 12 pixels for the h6 level.

Default headings
Default headings
Regular and light headings
Regular and light headings
VariantPurpose
H1Page title. Used once per page for the main heading.
H2Section title. Defines top-level content sections.
H3Sub-section titles. Used inside sections to separate content.
H4Nested subsections, often in detail-heavy contexts.
H5-H6Minor subsections, used for fine-grained grouping or labels.

Best practices

  • Use headings to define page and section titles: start each page with an h1, followed by h2-h6 for content hierarchy and structure.
  • Organize subsections with appropriate heading levels: use h3, h4, h5, h6 to title content within larger sections for better scannability.
  • Apply headings to group content semantically in UI elements: use headings inside, cards, or other containers to establish clear structure.
  • Support accessibility and SEO with semantic heading structure: proper use of heading tags enhances screen reader navigation and search engine indexing.
  • Always use the Heading component for structural content: don't manually style text to look like a heading. Use the component to maintain consistency and semantics.
  • Maintain proper heading order: avoid skipping levels (e.g., going from h1 to h4) unless there's a clear content structure that justifies it.
  • Avoid stacking headings without content: every heading should introduce related content. Don't chain multiple headings together without context
  • Use the level prop to set visual style, and as to control the semantic tag: while we recommend following the defined levels and styles to maintain consistency, we understand that certain interfaces may require customization. Use these props to adapt the component as needed and ensure semantic meaning and structural clarity are preserved.

Accessibility

  • Heading components should be in order. That means an Headings-H1 is followed by an Headings-H2, an Headings-H2 is followed by a Headings-H2 or Headings-H3 and so on.
  • Keep heading tags consistent. Inconsistently implementing headings can create confusion and frustration for users using assistive technologies.
  • Headings are not interactive elements and therefore have no keyboard or pointer interaction.