Menubar
A menubar component that displays a horizontal list of menus with nested items, checkboxes, and radio buttons. Built on top of bits-ui's Menubar for accessibility and keyboard navigation.
Import
import Menubar from "$lib/components/Menubar.svelte"; Basic Usage
A menubar with nested items, checkboxes, and radio buttons.
Properties
Name
Type
Description
menus
Type
MenubarMenu[]
Default: []
Array of menu configurations to display in the menubar.
Menu Item Properties
Name
Type
Description
label
Type
string
Default: -
The text label for the menu item.
icon
Type
string?
Default: -
Optional icon path for the menu item.
kbd
Type
string[]?
Default: -
Optional keyboard shortcut keys to display.
onClick
Type
() => void?
Default: -
Optional click handler for the menu item.
type
Type
"item" | "checkbox" | "radio"
Default: "item"
The type of menu item to display.
checked
Type
boolean?
Default: false
Whether a checkbox or radio item is checked.
items
Type
MenuItem[]?
Default: -
Optional submenu items.