Heading h1
The Heading h1 component represents the highest level heading, used for the main titles or sections. It ensures proper semantic structure and accessibility by using the HTML h1 tag, which is crucial for screen readers and SEO.
Semantic HTML h1 element
Flexible size adjustment
Optional trimming to remove line height
Supports text truncation for long titles
Architecture
Reference
-
Heading h1
Renders an HTML
h1element with configurable styling options. It provides control over text size, line height, trimming, and truncation behavior.-
Attributes
- idstring/ default: -
Specifies a unique identifier for the heading element. This can be used for linking, scripting or styling purposes.
- sizeenum/ default: 4xl
Determines the text size of the heading. Offers a range of predefined sizes from
xsto6xlto accommodate different design needs. - trimenum/ default: none
Controls the removal of excess line height at the start and/or end of the heading. This helps achieve precise vertical spacing in layouts. Use
nonefor default spacing,startorendfor single-sided trimming orbothfor trimming both sides. - truncateboolean/ default: false
Controls text truncation behavior. When set to
true, the text will be truncated with an ellipsis if it exceeds one line. Alternatively, you can specify a number to limit the visible lines before truncation occurs.
-
-