On this page

Menubar

Install, props and the parts Menubar is built from.

Install

Run this in the app, after shadcn-vue init and the Beehexa theme (Button › Code):

npx shadcn-vue@latest add https://beehexa.design/r/menubar.json

Use

<script setup lang="ts">
import {
  Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarTrigger,
} from '@/components/ui/menubar'
</script>

<template>
  <Menubar>
    <MenubarMenu>
      <MenubarTrigger>File</MenubarTrigger>
      <MenubarContent>
        <MenubarItem>New mapping<MenubarShortcut>Ctrl+N</MenubarShortcut></MenubarItem>
        <MenubarSeparator />
        <MenubarItem>Save<MenubarShortcut>Ctrl+S</MenubarShortcut></MenubarItem>
      </MenubarContent>
    </MenubarMenu>
  </Menubar>
</template>

Props

Part Prop Values Notes
Menubar v-model string The open menu’s value
Menubar loop boolean Left and Right wrap around the bar
MenubarContent align, sideOffset, alignOffset Default start, 4, -4
MenubarItem variant default, destructive Danger text and icon
MenubarItem, MenubarLabel, MenubarSubTrigger inset boolean Lines the text up with items that have an icon
MenubarItem disabled boolean Skipped by the arrow keys
MenubarItem @select event Runs the action. @select.prevent keeps the menu open
MenubarCheckboxItem v-model boolean On or off
MenubarRadioGroup v-model string The chosen MenubarRadioItem value
MenubarCheckboxItem, MenubarRadioItem slot indicator-icon Replaces the check

Built on

The reka-ui Menubar, with the shadcn-vue Menubar API. reka-ui gives role="menubar", the roving focus between menu names, the menu roles, typeahead and sub-menu keys. Beehexa adds the styles.