Cookbook / Counter

Counter

display

Minimal reactive counter — prop-backed count with increment/decrement/reset actions.

id
aihu-counter
since
0.5.0
file
aihu-counter.aihu
propactionon:clickinterpolation

Run it

live · runnable

The real, compiled aihu-counter.aihu component, hydrated as an island right here — fully interactive.

Source

aihu-counter.aihu

Requires

concerns
stateevents

Anti-patterns

  • Do not reach for state() when the value is part of the component's public surface — prop() makes it host-settable and attribute-visible.

Related recipes