Skip to content

Menu โ€‹

A recursive nav list โ€” items, collapsible groups, dividers, and subheaders โ€” driven by a single items array. Single or multi-select, three densities, seven colors (six themed + surface), two style variants (nav for the dashboard-pill look, plain for a softer subtle fill), badges with status colors, and Iconify icons via item.icon (e.g. i-mdi-view-dashboard). Designed to fit straight into <mono-sidebar>'s body slot to compose a Vuetify-style app shell. Toggle Vue / CSS to switch the live demo and source together.

Basic โ€‹

Flat list of clickable items with icons and the active item highlighted.

Vue SFC

Collapsible groups โ€‹

Section-style groups whose children expand and collapse on header click.

Vue SFC

Nested children โ€‹

Items can have a children array โ€” auto-rendered as an indented sub-list with a guide rail.

Vue SFC

Multi-select โ€‹

Multiple items can be active at once; modelValue becomes a string array.

Vue SFC

Iconify icons โ€‹

item.icon strings like i-mdi-view-dashboard resolve through UnoCSS preset-icons โ€” works with any icones.js.org collection.

Vue SFC

Badges โ€‹

Numeric counts and status pills via badge + badgeColor on each item.

Vue SFC

Dividers & subheaders โ€‹

Section labels and thin rules grouped via the divider and subheader item types.

Vue SFC

Plain variant โ€‹

nav={false} for a softer fill on the active item; useful in popovers and dialogs.

Vue SFC

Customized โ€‹

Override per-element styling via cssClass (Vue) or utility classes (CSS).

Vue SFC

Declarative nesting โ€‹

Stack <mono-menu-list> tags to any depth โ€” each tag is one row, children compose its body slot.

Vue SFC

Vue Router integration โ€‹

Real <a href> rows give status-bar URL preview, right-click "Open in new tab", and middle-click โ€” intercepted on plain click for SPA navigation via router.push.

Set controlled and bind model-value to the current route. In controlled mode the menu emits mno-click (so you can router.push) but does not move the highlight itself โ€” the active row follows model-value only. This keeps the highlight in sync with the page even when navigation is slow or async (lazy routes, awaited guards), so the menu can't jump ahead of the route that's actually rendered.

Vue SFC

Alias fallback โ€‹

When an item has no icon (and no slot icon), the renderer emits a 1โ€“2 character monogram derived from the title โ€” Dashboard โ†’ D, Post Budget โ†’ PB, Sales Order Report โ†’ SO. This is what rail-mode sidebars show when labels are hidden, so iconless rows still have a visual anchor.

Vue SFC

Types โ€‹

Importimport { MenuProps, MenuListProps } from 'mono-helper'
PropValueDefaultDescription
<mono-menu>
itemsMenuItemBase[][]Menu items rendered as a recursive list.
modelValuestring | string[]''Selected item id, or array of ids when multiple.
multiplebooleanfalseAllows selecting multiple items at once.
density'default' | 'compact' | 'comfortable''comfortable'Vertical spacing density of menu rows.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'surface''primary'Theme color applied to active and accent states.
navbooleantrueRenders rows as navigation links.
selectablebooleantrueEnables item selection and listbox semantics.
disabledbooleanfalseDisables interaction across the whole menu.
controlledbooleanfalseControlled mode โ€” the parent owns `modelValue` (e.g. bound to the current route). Clicks emit `mno-click` but the highlight doesn't move until `modelValue` updates. Use with Vue Router so the active item can't jump ahead of an async navigation.
cssClassMenuCssClass{}Per-part class overrides for internal elements.
cssClassNamestring''Plain root class string applied to the menu.
<mono-menu-list>
itemsMenuItemBase[][]In list mode: <mono-menu-list :items.prop="items" /> In direct single-row mode: <mono-menu-list type="group" title="Sales" :items.prop="children" /> Here, `items` becomes the built item's `children`. In declarative mode, child `<mono-menu-list>` elements (or any other HTML) compose the row's body โ€” arbitrary depth supported.
itemMenuItemBaseโ€”Render one full item object, useful with Vue `v-for`.
type'children' | 'item' | 'group' | 'divider' | 'subheader''children'Render mode, or the synthesised item's type in direct mode.
itemType'item' | 'group' | 'divider' | 'subheader'โ€”Direct single-row props. `item-type` is a legacy alias for `type` in declarative mode.
titlestring''Row title text.
subtitlestring''Secondary text shown beneath the title.
iconstring''Leading icon shown before the title.
appendIconstring''Trailing icon shown after the title.
badgestring | numberโ€”Badge content shown on the row.
badgeColor'primary' | 'success' | 'danger' | 'warning' | 'info' | 'default'โ€”Color theme of the badge.
hrefstring''Link target for navigation rows.
disabledbooleanfalseDisables interaction with the row.
defaultOpenbooleanfalseInitial expansion state for group rows.