# <sticky>

A header that pins to the top of its scrolling list while its section scrolls under it.

Category: Layout.

```ham
<block style="w-full h-400 rounded-xl border border-gray-300 dark:border-gray-700">
    <main>
        <sticky min-height="36"
                max-height="36">
            <block style="w-full px-12 py-8 bg-teal-600">
                <text style="text-white font-semibold">Today</text>
            </block>
        </sticky>
        <column style="p-12 gap-12">
            <text>Standup with the design team, 9:30</text>
            <text>Lunch with Priya, 12:30</text>
            <text>Review the Q4 roadmap, 15:00</text>
        </column>
        <sticky min-height="36"
                max-height="36">
            <block style="w-full px-12 py-8 bg-teal-600">
                <text style="text-white font-semibold">Tomorrow</text>
            </block>
        </sticky>
        <column style="p-12 gap-12">
            <text>Dentist, 8:15</text>
            <text>Flight to Berlin, 17:40</text>
        </column>
    </main>
</block>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/sticky-light.webp), [dark](https://hypeapps.dev/img/tags/sticky-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `max-height` | Maximum pinned height | `50` |
| `min-height` | Minimum pinned height | `50` |
| `mode` | Pinning mode: replace (push-off) or stack (accumulate) (replace, stack) | `replace` |

Any tag also takes gestures: `@on.tap`, `@on.longpress`, `@on.doubletap` and `@on.swipeleft` (and right, up and down). `@click` runs on a tap too.

## Related tags

- [`<block>`](https://hypeapps.dev/docs/reference/block.md): The general-purpose container: groups children and gives them padding, color, corners and a border.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<address>`](https://hypeapps.dev/docs/reference/address.md): Contact details as a block, in italic by default, as HTML's address element.
- [`<aside>`](https://hypeapps.dev/docs/reference/aside.md): A side note set apart from the main text, as HTML's aside element; it works like a block.
- [`<background>`](https://hypeapps.dev/docs/reference/background.md): The layer a swiped dismissible row reveals behind it, such as a red delete strip.
- [`<card>`](https://hypeapps.dev/docs/reference/card.md): A surface for grouped content, with padding, rounded corners and a soft shadow.
- [`<center>`](https://hypeapps.dev/docs/reference/center.md): Centers its children and their lines of text, on both axes or only one.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
