Menu
A list of actions or links that opens from a trigger. Every trigger opens the same menu, so items look and behave the same everywhere.
Default
Choosing an item sends
on_select
with its
value
and closes the menu. Destructive items go last.
<.menu id="menu-default" label="Actions">
<.menu_item value="rename" label="Rename project" />
<.menu_item value="duplicate" label="Duplicate project" />
<.menu_item value="transfer" label="Transfer project…" />
<.menu_separator />
<.menu_item value="delete" label="Delete project" variant="destructive" />
</.menu>
Dots
trigger="dots"
opens the menu from a dots button, for overflow actions on a row or card. The
label
names it for screen readers.
<.menu id="menu-dots" label="More actions" trigger="dots">
<.menu_item value="logs" label="View build logs" />
<.menu_item value="runs" label="View test runs" />
<.menu_item value="analytics" label="View analytics" />
</.menu>
Disabled items
Disabled items stay in place and keyboard navigation skips them, including destructive ones.
<.menu id="menu-disabled" label="Manage">
<.menu_item value="invite" label="Invite member" />
<.menu_item value="transfer" label="Transfer ownership" sublabel="Admins only" disabled />
<.menu_separator />
<.menu_item value="remove" label="Remove member" variant="destructive" disabled />
</.menu>
Link items
href
,
navigate
, or
patch
turn an item into a link.
<.menu id="menu-links" label="Help">
<.menu_item value="docs" label="Documentation" href="https://docs.tuist.dev" target="_blank" />
<.menu_item value="changelog" label="Changelog" href="#link-items" />
<.menu_item value="status" label="Status" href="https://status.tuist.dev" target="_blank" />
</.menu>
Prefix and suffix
A 16px
icon
or 20px
image
before the label, and
extra
content such as a badge after it.
<.menu id="menu-prefix-icons" label="Edit">
<.menu_item value="rename" label="Rename">
<:icon><.pencil /></:icon>
</.menu_item>
<.menu_item value="copy" label="Copy link">
<:icon><.copy /></:icon>
</.menu_item>
<.menu_item value="runners" label="Runners">
<:icon><.settings /></:icon>
<:extra><.badge label="New" color="primary" style="light-fill" /></:extra>
</.menu_item>
</.menu>
<.menu id="menu-prefix-images" label="ios-app">
<.menu_item value="ios-app" label="ios-app" truncate="middle" selected>
<:image><img src="/images/build-systems/xcode.png" alt="" /></:image>
</.menu_item>
<.menu_item value="android-app" label="android-app" truncate="middle">
<:image><img src="/images/build-systems/gradle.png" alt="" /></:image>
</.menu_item>
<.menu_item value="server" label="server" truncate="middle">
<:image><img src="/images/build-systems/mix.png" alt="" /></:image>
</.menu_item>
</.menu>
Shortcuts
Put a shortcut key in
extra
to show how to reach the action from the keyboard.
<.menu id="menu-shortcuts" label="File">
<.menu_item value="new" label="New project">
<:extra>
<.shortcut_key size="small">⌘N</.shortcut_key>
</:extra>
</.menu_item>
<.menu_item value="search" label="Search">
<:extra>
<.shortcut_key size="small">⌘K</.shortcut_key>
</:extra>
</.menu_item>
<.menu_item value="settings" label="Settings">
<:extra>
<.shortcut_key size="small">⌘,</.shortcut_key>
</:extra>
</.menu_item>
</.menu>
Checkbox items
checked
makes an item a checkbox for choosing several options. Items toggle in place and the menu stays open while people toggle.
<.menu id="menu-checkboxes" label="Columns">
<.menu_item value="status" label="Status" checked={true} />
<.menu_item value="duration" label="Duration" checked={true} />
<.menu_item value="branch" label="Branch" checked={false} />
<.menu_item value="ran-by" label="Ran by" checked={false} />
</.menu>
<.menu id="menu-checkbox-icons" label="Platforms">
<.menu_item value="ios" label="iOS" checked={true}>
<:icon><.device_mobile /></:icon>
</.menu_item>
<.menu_item value="macos" label="macOS" checked={false}>
<:icon><.device_desktop /></:icon>
</.menu_item>
<.menu_item value="watchos" label="watchOS" checked={true}>
<:icon><.device_watch /></:icon>
</.menu_item>
</.menu>
Selected
selected
marks the current choice with a check, for menus that pick one option.
<.menu id="menu-selected" label="Last 7 days">
<.menu_item value="24h" label="Last 24 hours" />
<.menu_item value="7d" label="Last 7 days" selected />
<.menu_item value="30d" label="Last 30 days" />
</.menu>
Descriptions
A
sublabel
qualifies the label; a
description
adds a second line. With
trigger="split"
, the label runs
on_action
and the chevron opens the menu.
<.menu id="menu-descriptions" label="Copy page" trigger="split" on_action="copy_page">
<.menu_item value="markdown" label="Copy as Markdown" sublabel="LLMs">
<:icon><.copy /></:icon>
</.menu_item>
<.menu_item
value="view"
label="View as Markdown"
description="Open this page as plain text in a new tab."
>
<:icon><.external_link /></:icon>
</.menu_item>
</.menu>
Guidelines
- Use a menu for actions on one thing, such as a project or a run. Keep it to about ten items.
- Write labels as a verb and a noun in sentence case, such as Rename project. Add … only when the item opens a dialog.
- Put destructive items last, after a separator, with a specific label such as Delete project.
-
Give an item either a 16px
iconor a 20pximage(an avatar or a logo). Keep leading content consistent within a menu so labels line up. -
Use
sublabelfor a short qualifier anddescriptionfor a sentence. A description makes the item two lines tall. -
Mark the current choice with
selected. It shows a check at the end of the item; it highlights like any other item only when hovered or reached with the keyboard. -
Use
checkedfor options people pick several of, such as visible columns. Items toggle as they're chosen, keep the menu open, and sendon_selectwith the newchecked. - Disable items that aren't available instead of hiding them, so the menu keeps its shape. Keyboard navigation skips them.
-
Long labels truncate. Use
truncate="middle"for identifiers such as schemes, branches, and project names, so both ends stay readable; keep the default end truncation for actions.
API reference
<.menu>
Also accepts global attributes.
<.menu_item>
Also accepts global attributes, including targetreldownload.
<.menu_separator>
Also accepts global attributes.


