Newer
Older
---
title: Heading
sidebar: true
---
# Heading
Heading element is used for different heading sizes. Heading type can be defined by giving the component heading attribute.
## Usage
### Basic usage
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Provide heading attribute for the component to choose what type of heading to use.
<hy-docs-container>
<hy-heading heading="h2">This uses h2</hy-heading>
</hy-docs-container>
```
<hy-heading heading="h2">This uses h2</hy-heading>
```
### Default heading
<hy-docs-container>
<hy-heading>Defaults to h1</hy-heading>
</hy-docs-container>
```
<hy-heading>Defaults to h1</hy-heading>
```
### different varians from h1 to h6
<hy-docs-container>
<hy-baseline>
<hy-heading heading="h1">This is a Heading 1</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h2">This is a Heading 2</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h3">This is a Heading 3</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h4">This is a Heading 4</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h5">This is a Heading 5</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h6">This is a Heading 6</hy-heading>
</hy-baseline>
</hy-docs-container>
```
<hy-docs-container>
<hy-baseline>
<hy-heading heading="h1">This is a Heading 1</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h2">This is a Heading 2</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h3">This is a Heading 3</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h4">This is a Heading 4</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h5">This is a Heading 5</hy-heading>
</hy-baseline>
<hy-baseline>
<hy-heading heading="h6">This is a Heading 6</hy-heading>
</hy-baseline>
</hy-docs-container>
```
<!-- Auto Generated Below -->
## Properties
| Property | Attribute | Description | Type | Default |
| --------- | --------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `heading` | `heading` | | `HeadingVarians.default \| HeadingVarians.h2 \| HeadingVarians.h3 \| HeadingVarians.h4 \| HeadingVarians.h5 \| HeadingVarians.h6` | `HeadingVarians.default` |
----------------------------------------------
HY component demo