1. Reference
  2. Metadata

<globals>

Declares app-wide variables, kept across pages and optionally saved on the device.

Metadata
globals.ham
<column style="gap-8 w-full">
    <globals persist
             volume="60"/>
    <text style="font-bold">Volume @{$volume}</text>
    <slider name="volume"
            value="$volume"
            min="0"
            max="100"/>
</column>
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
persist Keep these variables across restarts (per app); the declared values are the first-launch defaults. Text, numbers, true/false, and lists and maps of them come back as they were: a list stays a list.
boolean
false

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.

Guides and recipes that use it

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