1. Reference
  2. Forms and input

<checkbox>

A checkbox with a label; its state goes into a variable by name.

Forms and input
checkbox.ham
<column style="gap-4">
    <checkbox name="milk"
              color="teal"
              label="Oat milk"
              checked="true"/>
    <checkbox name="bread"
              label="Sourdough loaf"/>
    <checkbox name="eggs"
              label="A dozen eggs"/>
</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
checked Initial checked state
boolean
false
color Active color
color
label Checkbox label
string
name Variable name for form scoping
string

Readings

NameWhat it does
checked The same as value, named after checked=.
value Whether it is on, live.

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.

Guides and recipes that use it

This page is also Markdown, and all of HAM is in llms.txt.