# Heading

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/heading
- **Markdown:** https://refast.fastapicloud.dev/docs/components/heading.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/typography/heading.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

HTML heading elements `<h1>` through `<h6>` with consistent typography styles.

```python
from refast.components import Heading

Heading("Page Title", level=1)
Heading("Section", level=2, class_name="text-blue-600")
Heading("Sub-section", level=3)
```

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `text` | `str` | *(required)* | Heading content |
| `level` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `1` | HTML heading level (`h1`–`h6`) |
| `id` | `str \| None` | `None` | Unique element ID |
| `class_name` | `str` | `""` | Extra Tailwind classes |
| `style` | `dict \| None` | `None` | Inline CSS overrides |

## All Levels

| Level | Tag | Default Style |
|-------|-----|---------------|
| `1` | `<h1>` | `text-4xl font-extrabold` |
| `2` | `<h2>` | `text-3xl font-semibold` |
| `3` | `<h3>` | `text-2xl font-semibold` |
| `4` | `<h4>` | `text-xl font-semibold` |
| `5` | `<h5>` | `text-lg font-medium` |
| `6` | `<h6>` | `text-base font-medium` |

## Examples

```python
Column(
    gap=2,
    children=[
        Heading("Dashboard", level=1),
        Heading("Recent Activity", level=2),
        Heading("Today", level=3, class_name="text-muted-foreground"),
    ],
)
```

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
