# <notification>

Wires local and push notifications into the page: schedule one, and act when one is tapped.

Category: Metadata. Uses notifications.

This tag needs notification permission on a device, so try it on your phone.

```ham
<column style="gap-12 w-full">
    <notification permission="silent"
                  on-tap="file:/$notify.data.route"/>
    <text style="font-bold">Daily reminder</text>
    <button variant="filled"
            icon="notifications"
            action="notify:Time to stretch:Stand up for two minutes.:delay:600">Remind me in 10 minutes</button>
</column>
```

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

## Attributes

| Name | What it does | Default |
|---|---|---|
| `at` | When to show it: ISO 8601, or HH:mm for the next occurrence today/tomorrow. |  |
| `body` | Body of the declarative local notification. |  |
| `local` | true schedules one local notification declaratively on mount (needs title). |  |
| `permission` | ask requests OS permission on mount if not yet decided; silent / deferred never auto-request (call notify:permission:request). (ask, silent, deferred) | `ask` |
| `register` | Endpoint to POST the push device token to: {token, device_id, platform, authorization}, and on iOS apns_environment (development or production). authorization is what the OS allows now (iOS: authorized, denied, provisional, ephemeral, notDetermined; Android: granted, denied): iOS gives a token with alerts turned off. Sent once per endpoint, token, session and authorization: after a sign-out and a sign-in, or notifications turned on or off in Settings, it is sent again. |  |
| `tag` | Stable id: rescheduling with the same tag replaces; notify:cancel:{tag} cancels. |  |
| `title` | Title of the declarative local notification. |  |

## Events

| Name | What it does |
|---|---|
| `on-receive` | Action run when a notification arrives while the app is open. |
| `on-tap` | Action run when the user taps a notification, including the tap that cold-launched the app. |

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

- [`<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.
- [`<button>`](https://hypeapps.dev/docs/reference/button.md): A tappable button that runs an action: a fetch, a navigation or a statement.
- [`<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.
- [`<globals>`](https://hypeapps.dev/docs/reference/globals.md): Declares app-wide variables, kept across pages and optionally saved on the device.
- [`<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
