1. Reference
  2. Overlays

<dropdown>

A Material dropdown menu: a field that opens a list of choices; the chosen value is readable by id.

Overlays
dropdown.ham
<column style="gap-12">
    <dropdown id="size"
              label="Size">
        <menu-item value="s">Small</menu-item>
        <menu-item value="m">Medium</menu-item>
        <menu-item value="l">Large</menu-item>
    </dropdown>
</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
expanded Fill the available width.
boolean
false
label Dropdown label.
string

Readings

NameWhat it does
index The chosen item's position, from 0; -1 when none.
label The chosen item's text; empty when none.
value The chosen item's value; empty when none.

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.