Menubar

Uma barra de menus no estilo desktop construída com a família de menus: uma única parada de tabulação, setas entre os menus e para os vizinhos, e troca ao passar o ponteiro quando um menu está aberto.

Disponível em
  • Angular: disponível
  • Vue: disponível
  • React: disponível
  • React Native: ainda não disponível

Uso

Importação

ts
import {
  SoneMenubarDirective,
  SoneMenubarTriggerDirective,
} from "@surface-one/angular/menubar";

Referência da API

SoneMenubarDirectiveDiretiva

`[soneMenubar]` — a horizontal bar of menus (spartan/ui Menubar, WAI-ARIA menubar pattern): `role="menubar"`, one Tab stop (roving tabindex) over its `soneMenubarTrigger`s, ArrowLeft / ArrowRight, Home and End between them. Name it with `aria-label`.

Seletor
[soneMenubar]
Exportado como
soneMenubar

SoneMenubarTriggerDirectiveDiretiva

`[soneMenubarTrigger]` — a top-level item of a `soneMenubar` (`role="menuitem"`, `aria-haspopup="menu"`, `aria-expanded`) that opens a `[soneMenu]` — the menu family's panel, items, submenus and keys. Enter, Space and ArrowDown open it on the first item, ArrowUp on the last; inside it ArrowLeft / ArrowRight close it and open the neighbouring menu; once a menu is open, hovering another trigger switches to it.

Seletor
[soneMenubarTrigger]
Exportado como
soneMenubarTrigger
Inputs
NomeTipo Padrão
side

The side of the trigger the panel opens on; it flips when that side lacks room.

FloatingSide"bottom"
align

Alignment along the trigger's edge.

FloatingAlign"start"
offset

Gap between the trigger and the panel, in px.

number4
openbidirecional

Shown or not — `[(open)]`.

booleanfalse
keepOpenOnOutsideClick

Keep the panel open on a click outside it (Escape still closes it).

booleanfalse
soneMenuTriggerSoneOverlayContent | nullnull
soneMenubarTriggerSoneOverlayContent | nullnull