# Tags and attributes

URL: https://tuimark.dev/reference/tags

> Every Tuimark tag and the exact attributes it accepts, and what a document that pins an older version leaves out.

{/* Generated by docs/scripts/generate.mjs from `tuimark agents`. Do not edit by hand: run `task docs-gen`. */}

The vocabulary is closed: a tag outside this page is `V001`, and an attribute a tag does not list is `V002`. This page is generated from the same catalog the runtime validates against. A `<tui>` without `version` is the current language and accepts every tag and attribute below. The sections after the first mark what a document that pins `version="1"`, `"2"`, or `"3"` leaves out, and the last one what only the current language accepts: `checkbox`, `select`, `include`, `fragment`, `template`, `use`, `single`, and `indeterminate`. See [The .tui language](/guide/language) for what each tag does.

## Every version [#every-version]

| Tag | Attributes |
|---|---|
| `<bind>` | `action` `keys` `to` `when` |
| `<box>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<button>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `label` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<col>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<input>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:change` `on:click` `on:focus` `on:submit` `pad` `placeholder` `secret` `style` `title` `width` |
| `<item>` | `border` `class` `disabled` `gap` `height` `hidden` `id` `if` `pad` `style` `title` `width` |
| `<keymap>` | — |
| `<list>` | `bind` `border` `class` `disabled` `each` `focusable` `gap` `height` `hidden` `id` `if` `key` `on:click` `on:focus` `on:select` `pad` `style` `title` `width` |
| `<modal>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:close` `on:escape` `on:focus` `on:open` `open` `pad` `style` `title` `width` |
| `<progress>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `value` `width` |
| `<row>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<rule>` | `axis` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<screen>` | `class` `focus` `id` `style` `title` |
| `<scroll>` | `axis` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<spacer>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<style>` | `src` |
| `<text>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `style` `title` `width` `wrap` |
| `<tui>` | `theme` `version` |

Inside a list `<item>` nothing takes focus (the list does and navigates its rows): no `input`, `button`, `list`, or `modal` (V001), and no `focusable`, `on:click`, or `on:focus` (V002) anywhere in the row. Handle a row with the list's `on:select`, or a keymap row such as `<bind keys="d" action="delete" when="#rows:focus"/>` for `<list id="rows">` (its event identifies the selected row).

Bindings contain no spaces: `{path}`, `if="path"`, `if="!path"`, and exactly one space on each side of `as` in `each="path as alias"`.

## Added by `version="2"` [#added-by-version2]

Only in a `<tui version="2">` document (V002 with `(requires version="2")` in a version="1" one): the additions to the tags above, and the full attribute sets of the new tags:

| Tag | Attributes |
|---|---|
| `<bind>` | `keycap` `label` |
| `<box>` | `each` `key` |
| `<col>` | `each` `key` |
| `<column>` | `class` `id` `on:click` `style` `title` `width` |
| `<hints>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `scope` `style` `title` `width` |
| `<list>` | `checked` `mark` `on:change` |
| `<row>` | `each` `key` |
| `<sparkline>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `max` `min` `on:click` `on:focus` `pad` `style` `title` `width` |
| `<tab>` | `border` `class` `disabled` `focus` `gap` `hidden` `id` `if` `label` `pad` `short` `style` `title` |
| `<table>` | `bind` `border` `checked` `class` `disabled` `each` `focusable` `gap` `height` `hidden` `id` `if` `key` `mark` `on:change` `on:click` `on:focus` `on:select` `pad` `placeholder` `style` `title` `width` |
| `<tabs>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `mark` `on:click` `on:focus` `on:select` `pad` `style` `title` `width` |
| `<tui>` | `mouse` |

- `item` inside a `table`: class only (plus `class:NAME`)
- every tag except `tui`, `style`, `keymap`, `bind`, and the composition tags (`include`, `fragment`, `template`, `use`, `slot`): `class:NAME` (the name is open and lowercase, `[a-z_][a-z0-9_-]*`; the value is `path` or `!path`)

## Added by `version="3"` [#added-by-version3]

Only in a `<tui version="3">` document (V002 with `(requires version="3")` in a version="1" or version="2" one): these attributes on top of the tags above (a tag itself unknown in an older version still gets only its own V001, with the version="2" hint, so an attribute on it — `scale` on `sparkline`, `priority` on `column` — reports nothing further there):

| Tag | Attributes |
|---|---|
| `<column>` | `priority` |
| `<keymap>` | `when` |
| `<modal>` | `focus` |
| `<scroll>` | `stick` |
| `<sparkline>` | `scale` |

## Added by the current language [#added-by-the-current-language]

Only in a `<tui>` without `version` (V001 or V002 with ` (requires a <tui> without version)` in a document that writes `version`): these attributes on top of the tags above, and the full attribute sets of the new tags:

| Tag | Attributes |
|---|---|
| `<checkbox>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `label` `on:change` `on:focus` `pad` `style` `title` `width` |
| `<fragment>` | — |
| `<img>` | `alt` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:click` `on:focus` `pad` `quality` `src` `style` `title` `width` |
| `<include>` | `src` |
| `<list>` | `single` |
| `<progress>` | `indeterminate` |
| `<select>` | `bind` `border` `class` `disabled` `each` `focusable` `gap` `height` `hidden` `id` `if` `key` `label` `on:change` `on:focus` `pad` `placeholder` `style` `title` `width` |
| `<slot>` | — |
| `<table>` | `single` |
| `<template>` | `id` `props` |
| `<text>` | `border` `class` `disabled` `focusable` `gap` `height` `hidden` `href` `id` `if` `on:click` `on:focus` `pad` `runs` `style` `title` `width` |
| `<textarea>` | `bind` `border` `class` `disabled` `focusable` `gap` `height` `hidden` `id` `if` `on:change` `on:click` `on:focus` `on:submit` `pad` `placeholder` `style` `title` `width` |
| `<use>` | `class` `hidden` `id` `if` `template` `with` |

A `<use>` also takes one attribute per prop its template declares in `props` (`tuimark catalog` shows this as `"open_attrs": "props"` on `use`).
