VerticalMenuButton

Updated: Sep 24, 2026
VerticalMenuButton is the one supported child of VerticalMenu. It is a Container rendered as a button by default, laying out an optional leading icon next to a text label. Its width is filled from the menu so every row lines up, and its height grows with the label, which wraps rather than truncating.
The component owns the row material, its default shape, the menu-item role, the fixed icon slot, and the accessible name it derives from text. You own the label, the icon, the disabled state, and the activation handler.

Usage

import { VerticalMenu, VerticalMenuButton } from '@wearables-ui-toolkit/mrbd';

<VerticalMenu aria-label="Photo actions" onDismissRequest={closeMenu}>
  <VerticalMenuButton
    text="Add to album"
    icon={bookmarkIcon}
    onClick={event => activateItem(event, addToAlbum)}
  />
  <VerticalMenuButton
    text="Hide from feed"
    icon={eyeOffIcon}
    disabled={!canHide}
    onClick={event => activateItem(event, hideFromFeed)}
  />
</VerticalMenu>;
Pass as to change the rendered element. The row keeps its menu-item role, material, and keyboard behavior, and the forwarded ref is typed by whatever you render as.
import { useRef } from 'react';
import { Link } from 'react-router-dom';
import { VerticalMenu, VerticalMenuButton } from '@wearables-ui-toolkit/mrbd';

export function SettingsMenu({ onDismiss }: { onDismiss: () => void }) {
  const settingsRef = useRef<HTMLAnchorElement>(null);

  return (
    <VerticalMenu aria-label="More" onDismissRequest={onDismiss}>
      <VerticalMenuButton
        as={Link}
        ref={settingsRef}
        to="/settings"
        text="Settings"
        icon={gearIcon}
      />
    </VerticalMenu>
  );
}

Props

The full prop type is VerticalMenuButtonProps. It is ContainerProps with ariaLabel, children, height, material, role, and width removed — those belong to the component — plus the two own props below.

Own props

PropTypeDefaultDescription
text
string
Required
The label. Also becomes the row’s accessible name.
icon
IconSource
—
Optional decorative leading icon. When omitted, the icon slot and its gap collapse and the label moves to the start of the row.

Notable inherited props

Everything else Container offers still applies — focusable, onLongPress, onStateChange, the tooltip props, and so on. These are the ones that matter most here.
PropTypeDefaultDescription
as
ElementType
'button'
Element or component to render as, for example a router link.
type
'button' \| 'reset' \| 'submit'
'button' when rendered as a button, otherwise unset
Submit behavior of the underlying button element.
onClick
MouseEventHandler
—
Activation handler. Receives the DOM event so you can stop it from reaching the trigger.
onActivate
(event: InteractableActivationEvent) => void
—
Fires once per activation and reports the originating pointer or keyboard event.
disabled
boolean
false
Renders the unavailable state, blocks activation, and removes the row from the menu’s arrow movement.
shapeProvider
ShapeProvider
Small rounded rectangle
Geometry used for clipping and material paths.
aria-label
string
Falls back to text
Overrides the derived accessible name. Use it only when the visible label would read badly on its own.
className
string
''
Extra class on the row root.
style
CSSProperties
—
Inline styles on the row root.

Behavior

  • Sizing. The row fills the menu width and sizes its height to the label. Width and height are not part of the API.
  • Material. The row uses the standard container material with the glow suppressed in the idle state, so rows sit flat on the menu surface and light up only when focused or pressed.
  • Icon slot. The icon is a fixed-size, non-shrinking slot laid out before the label with the standard spacing gap, tinted with --uit-color-icon-primary. With no icon, both the slot and the gap collapse, so a menu of label-only rows stays aligned to the start of the row.
  • Label. Text renders through TextView in the compact meta type ramp, starts at the leading edge, and wraps within the row rather than truncating — it will break inside a long word if it has to. Long labels make the row, and the menu, taller.
  • Element. By default the row is a real button with type="button", so it never submits an enclosing form. When you pass as, the component renders that element instead and only defaults type for a real button.
  • Movement. The parent menu moves focus between rows with Up, Down, Home, and End, and skips rows that are disabled, hidden, inert, or otherwise unfocusable. Activation is Enter, Space, or a pointer click.
  • Ref. The forwarded ref lands on the rendered element, typed by as.

Accessibility

  • Each row exposes role="menuitem" and is named by its text; pass aria-label to override that name.
  • The leading icon is decorative and contributes no name, so the label must carry the whole meaning of the command.
  • A disabled row stays in the reading order, which keeps an unavailable command discoverable while removing it from arrow movement.
  • Because the label wraps instead of truncating, the announced name always matches the visible text.
  • Use one short, verb-led command per row.
  • Use filled icon variants when an icon genuinely aids recognition.
  • Show a disabled row when the command must remain visible but is not currently available.
  • Stop the click event before it reaches the menu’s trigger.
  • Use as with your router’s link component when a row navigates, so it gets a real href.

Avoid

  • Avoid adding navigation chevrons or trailing accessories.
  • Avoid putting arbitrary interactive descendants inside a menu row.
  • Avoid setting a width, height, or custom row padding.
  • Avoid using aria-label to say something the visible label does not.
  • Avoid using these rows outside VerticalMenu.