Heading
Alignment target:@astryxdesign/core v0.7.1 · Heading
Heading Level 1
Heading Level 2
Heading Level 3
Heading Level 4
Heading Level 5
Heading Level 6
Usage #
Import the component from its dedicated entry. Structural styles are loaded automatically.
Vue
<script setup lang="ts">
import { Heading } from '@astryx-vue/core/Heading'
</script>
<template>
<Heading :level="1">
Page title
</Heading>
<Heading :level="2" type="display-2">
Overview
</Heading>
</template>Best practices #
| Guidance | Practice |
|---|---|
| Recommended | Choose level to match the document outline; avoid skipping levels. |
| Recommended | Use type="display-*" for marketing or large callouts while keeping the semantic level. |
| Recommended | Use color="secondary" for lower-emphasis headings. |
| Don't | Pick a level purely for visual size. Use type for visuals and level for semantics. |
| Don't | Put long paragraphs inside headings. Keep headings short. |
Examples #
Heading — Card grid
Card Title
This is a card description that might be quite long and needs to be truncated after two lines to keep the card compact and uniform. Updated 1 hour agoResponsive card grid with truncated headings and descriptions for uniform layout.
Heading — Page hierarchy
Dashboard Overview
Last updated 5 minutes agoRecent Activity
Here's what's been happening in your workspace.Today
• Project Alpha updated• 3 new comments
• Task completed
Real-world page layout demonstrating heading levels h1 through h3 with supporting text.
Heading — Truncation
Very Long Heading That Will Be Truncated To One Line With Ellipsis
Very Long Heading That Will Be Truncated To Two Lines To Keep Card Layout Compact
Single-line and multi-line heading truncation with ellipsis for constrained layouts. Hover reads the full text once it is cut off.
Heading — Outline and alignment
Quarterly review
Draft agenda
The visual size stays on the page. The outline level is what assistive technology reads.
The visual level and the outline level can differ. Strikethrough and alignment stay on the heading.