# <flex>

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

Category: Layout.

```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>
```

How Hype Apps draws it on a phone: [light](https://hypeapps.dev/img/tags/flex-light.webp), [dark](https://hypeapps.dev/img/tags/flex-dark.webp).

## Attributes

| Name | What it does | Default |
|---|---|---|
| `column_widths` | Space-separated widths: '80px 1' (80px fixed, 1 flex), supports px, %, flex units and auto (as wide as its content: 'auto 1') |  |
| `columns` | Number of columns | `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

- [Rows the server updates (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-watchlist.md)
- [Pick the right match (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-match.md)
- [Search on the server (MoviePlz)](https://hypeapps.dev/docs/cookbook/movieplz-search.md)

## Related tags

- [`<column>`](https://hypeapps.dev/docs/reference/column.md): Stacks its children top to bottom, with a gap between them and an alignment across.
- [`<icon>`](https://hypeapps.dev/docs/reference/icon.md): A Material Symbols icon, with its style, weight, size and color set in its name.
- [`<text>`](https://hypeapps.dev/docs/reference/text.md): A run of text; with @text it shows an expression that updates as its variables change.
- [`<address>`](https://hypeapps.dev/docs/reference/address.md): Contact details as a block, in italic by default, as HTML's address element.
- [`<aside>`](https://hypeapps.dev/docs/reference/aside.md): A side note set apart from the main text, as HTML's aside element; it works like a block.
- [`<background>`](https://hypeapps.dev/docs/reference/background.md): The layer a swiped dismissible row reveals behind it, such as a red delete strip.
- [`<block>`](https://hypeapps.dev/docs/reference/block.md): The general-purpose container: groups children and gives them padding, color, corners and a border.
- [`<card>`](https://hypeapps.dev/docs/reference/card.md): A surface for grouped content, with padding, rounded corners and a soft shadow.

All tags: https://hypeapps.dev/docs/reference.md · The full reference: https://hypeapps.dev/llms.txt
