# <state>

Declares a draw tool's own variables and starting values, read and written as $tool.* by its handlers.

Category: Metadata.

```ham
<draw-tool name="stamp"
           label="Stamp"
           icon="approval"
           @on.touch.end="$tool.count = $tool.count + 1">
    <state count="0"/>
    <options>
        <column style="gap-8 p-12">
            <text style="font-semibold">Stamp</text>
            <text style="muted">Tap the page to place a stamp.</text>
        </column>
    </options>
</draw-tool>
```

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

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

- [`<options>`](https://hypeapps.dev/docs/reference/options.md): Inside a drawing tool written in HAM, the tool's options popover.
- [`<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.
- [`<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.
- [`<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.
- [`<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
