Menubar

Una barra de menús al estilo de escritorio construida con la familia de menús: una sola parada de tabulación, flechas entre los menús y hacia sus vecinos, y cambio al pasar el puntero cuando hay un menú abierto.

Disponible en
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: aún no disponible

Uso

Importación

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

Referencia de la API

SoneMenubarDirectiveDirectiva

`[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`.

Selector
[soneMenubar]
Exportar como
soneMenubar

SoneMenubarTriggerDirectiveDirectiva

`[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.

Selector
[soneMenubarTrigger]
Exportar como
soneMenubarTrigger
Inputs
NombreTipo Predeterminado
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
openbidireccional

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

booleanfalse
keepOpenOnOutsideClick

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

booleanfalse
soneMenuTriggerSoneOverlayContent | nullnull
soneMenubarTriggerSoneOverlayContent | nullnull