1. Reference
  2. Metadata

<state>

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

Metadata
state.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>
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.

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.