1. Reference
  2. Forms and input

<button>

A tappable button that runs an action: a fetch, a navigation or a statement.

Forms and input
button.ham
<column style="gap-12">
    <button>Continue</button>
    <button style="bg-white text-primary border border-primary">Cancel</button>
</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
color Background/foreground color
color
icon Icon name; with no text and no children the button is the icon alone
string
size Button size preset
xs, sm, md, lg, xl
md
style Style classes (also parses size, variant, color as shorthand tokens)
string
text Button label text (when no children; none with icon= alone)
string
Button
variant Button style variant
elevated, filled, tonal, outlined, plain, text
elevated

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.