# <globals>

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

Category: Metadata.

```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>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `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. | `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

- [Navigation](https://hypeapps.dev/docs/guides/navigation.md)
- [Animations and effects](https://hypeapps.dev/docs/guides/animations.md)

## Related tags

- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<slider>`](https://hypeapps.dev/docs/reference/slider.md): A Material slider that picks a number between min and max, optionally in steps.
- [`<config>`](https://hypeapps.dev/docs/reference/config.md): App settings, not drawn itself: theme color, fonts, dark mode and the default look of each tag.
- [`<notification>`](https://hypeapps.dev/docs/reference/notification.md): Wires local and push notifications into the page: schedule one, and act when one is tapped.
- [`<shake>`](https://hypeapps.dev/docs/reference/shake.md): An invisible motion sensor that publishes live acceleration readings as $id variables.
- [`<state>`](https://hypeapps.dev/docs/reference/state.md): Declares a draw tool's own variables and starting values, read and written as $tool.* by its handlers.
- [`<styles>`](https://hypeapps.dev/docs/reference/styles.md): Declares named style aliases: each attribute becomes a style token that expands to its value.

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