1. Reference
  2. Forms and input

<option>

One choice in a select list, with the value it stands for.

Forms and input
option.ham
<column style="gap-8 w-full">
    <select id="size"
            name="size">
        <option value="s">Small</option>
        <option value="m"
                selected="true">Medium</option>
        <option value="l">Large</option>
    </select>
    <text @text="'Size: ' + #size.label"></text>
</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
selected Initially selected
boolean
false
value Option value; without it, the option is worth its text (as in HTML).
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.