1. Reference
  2. Layout

<flex>

A single row laid out like a table: fixed-width columns beside flexible ones.

Layout
flex.ham
<column style="gap-12 w-full">
    <flex column_widths="36px 1 64px">
        <icon name="volume_up"/>
        <text>Speak English</text>
        <text style="muted text-right">On</text>
    </flex>
    <flex column_widths="36px 1 64px">
        <icon name="translate"/>
        <text>Translate captions</text>
        <text style="muted text-right">Off</text>
    </flex>
</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
column_widths Space-separated widths: '80px 1' (80px fixed, 1 flex), supports px, %, flex units and auto (as wide as its content: 'auto 1')
string
columns Number of columns
number
1

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.