Menubar

メニューファミリーで組み立てたデスクトップ風のメニューバー。Tab の停止位置は一つだけで、矢印キーでメニュー間や隣のメニューへ移動し、メニューが開いている間はホバーで切り替わります。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 未対応

使い方

インポート

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

API リファレンス

SoneMenubarDirectiveディレクティブ

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

セレクター
[soneMenubar]
エクスポート名
soneMenubar

SoneMenubarTriggerDirectiveディレクティブ

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

セレクター
[soneMenubarTrigger]
エクスポート名
soneMenubarTrigger
入力
名前型 デフォルト
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
open双方向

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

booleanfalse
keepOpenOnOutsideClick

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

booleanfalse
soneMenuTriggerSoneOverlayContent | nullnull
soneMenubarTriggerSoneOverlayContent | nullnull