1. Reference
  2. Layout

<sticky>

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

Layout
sticky.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>
The snippet drawn by Hype Apps on a phone, in light mode The snippet drawn by Hype Apps on a phone, in dark mode
This snippet as Hype Apps draws it on a phone. It follows this page's light or dark theme.

Attributes

NameWhat it doesDefault
max-height Maximum pinned height
number
50
min-height Minimum pinned height
number
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.

This page is also Markdown, and all of HAM is in llms.txt.