1. Reference
  2. Structure

<update>

In a stream event, sends its content into another element by id; elsewhere it is a plain block.

Structure
update.ham
<column style="w-full gap-8">
    <block id="score"
           style="w-full p-16 rounded-xl border border-gray-300 dark:border-gray-700">
        <text style="font-semibold">Arsenal 1 – 0 Chelsea</text>
    </block>
    <update target="#score"
            swap="inner">
        <text style="muted">Next event: Arsenal 2 – 0 Chelsea, 67'</text>
    </update>
</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
swap How it goes in.
inner, outer, before, after
inner
target The element it updates (#id).
string

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.