Install
Run these in the app, after shadcn-vue init and the Beehexa theme (Button › Code):
npx shadcn-vue@latest add https://beehexa.design/r/button.json
npx shadcn-vue@latest add https://beehexa.design/r/dropdown-menu.json
Use
<script setup lang="ts">
import { ChevronDown, FileSpreadsheet, FileText, Link } from '@lucide/vue'
import { Button } from '@/components/ui/button'
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
</script>
<template>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<Button variant="outline">Export<ChevronDown /></Button>
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem><FileText />Export as CSV</DropdownMenuItem>
<DropdownMenuItem><FileSpreadsheet />Export as Excel</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem><Link />Copy link</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</template>
Props
| Prop | Values | Notes |
|---|---|---|
DropdownMenuTrigger as-child |
boolean | Puts the menu behaviour on the Button inside |
DropdownMenuContent align |
start (default), center, end |
end for a button at the end of a row |
DropdownMenuItem variant |
default, destructive |
Danger tone for delete |
DropdownMenuItem disabled |
boolean | Skipped by arrow keys |
Built on
The Dropdown menu wraps the reka-ui DropdownMenu with the same API as shadcn-vue. A menu button is a Button inside DropdownMenuTrigger as-child.