# SbHeading Semantic heading component that renders h1-h6 elements with consistent typography styles. Supports visual size override for flexible design while maintaining proper document structure. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Level | int | 2 | Semantic heading level (1-6), determines the HTML tag | | Size | int? | null | Visual size override (1-6). If not set, matches Level | | Color | SbColor | Default | Text color | | Align | SbTextAlign | Start | Text alignment (Start, Center, End) | | Truncate | bool | false | Truncates text with ellipsis on overflow | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | | AdditionalAttributes | Dictionary? | null | Additional HTML attributes | ## Templates / Slots | Slot | Type | Description | |------|------|-------------| | ChildContent | RenderFragment? | Heading text content | ## CSS Classes - `sb-heading` - Base class - `sb-heading--h1` through `sb-heading--h6` - Size variants - `sb-heading--primary` - Primary color - `sb-heading--secondary` - Secondary color - `sb-heading--success` - Success color - `sb-heading--warning` - Warning color - `sb-heading--danger` - Danger color - `sb-heading--align-center` - Center aligned - `sb-heading--align-end` - End aligned - `sb-heading--truncate` - Text truncation ## Rendered Element Renders the appropriate heading tag based on `Level`: - Level 1 → `

` - Level 2 → `

` - Level 3 → `

` - Level 4 → `

` - Level 5 → `

` - Level 6 → `
` ## Examples ### Basic Headings ```razor Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 ``` ### Visual Size Override Use `Size` to visually style a heading differently from its semantic level. This is useful for maintaining proper document structure while achieving desired visual hierarchy. ```razor @* Semantically h2, but visually styled as h4 *@ Section Title @* Semantically h3, but visually styled as h1 *@ Important Subsection ``` ### Colors ```razor Primary Heading Secondary Heading Success Heading Warning Heading Danger Heading ``` ### Text Alignment ```razor Left Aligned Center Aligned Right Aligned ``` ### Text Truncation ```razor
This is a very long heading that will be truncated
``` ### Page Header ```razor
Dashboard Welcome back, John
``` ### Card Header ```razor
Card Title

Card content goes here.

``` ### Section with Subheading ```razor
Main Section Introduction paragraph for this section. Subsection A

Content for subsection A...

Subsection B

Content for subsection B...

``` ### Hero Section ```razor
Build Better Apps A comprehensive component library for Blazor applications. Get Started
``` ### Accessibility Best Practices ```razor @* Maintain proper heading hierarchy for accessibility *@
Article Title
First Section

Content...

Subsection

More content...

Second Section

Content...

```