Sections
Get Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Form
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Number Field
- Pagination
- Pin Input
- Popover
- Progress
- Radio Group
- Range Calendar
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Stepper
- Switch
- Table
- Tabs
- Tags Input
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Forms
Displays a menu to the user — such as a set of actions or functions — triggered by a button.
<!-- AUTO-GENERATED BY scripts/generate-custom-demos.ts. DO NOT EDIT DIRECTLY. -->
<script setup lang="ts">
import VButton from '@ui-kit/src/components/Base/VButton/VButton.vue'
import {
VDropdownMenu,
VDropdownMenuContent,
VDropdownMenuItem,
VDropdownMenuSub,
VDropdownMenuSubContent,
VDropdownMenuSubTrigger,
VDropdownMenuTrigger,
} from '@ui-kit/src/components/Base/VDropdownMenu'
</script>
<template>
<VDropdownMenu>
<VDropdownMenuTrigger as-child>
<VButton variant="outlined">
Open menu
</VButton>
</VDropdownMenuTrigger>
<VDropdownMenuContent class="min-w-56" side-offset="8">
<VDropdownMenuItem>Edit profile</VDropdownMenuItem>
<VDropdownMenuItem>Share link</VDropdownMenuItem>
<VDropdownMenuSub>
<VDropdownMenuSubTrigger>Move to</VDropdownMenuSubTrigger>
<VDropdownMenuSubContent class="min-w-40">
<VDropdownMenuItem>Backlog</VDropdownMenuItem>
<VDropdownMenuItem>In review</VDropdownMenuItem>
</VDropdownMenuSubContent>
</VDropdownMenuSub>
</VDropdownMenuContent>
</VDropdownMenu>
</template>Installation
pnpm dlx shadcn-vue@latest add dropdown-menu
Usage
<script setup lang="ts">
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu'
</script>
<template>
<DropdownMenu>
<DropdownMenuTrigger>Open</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem>Profile</DropdownMenuItem>
<DropdownMenuItem>Billing</DropdownMenuItem>
<DropdownMenuItem>Team</DropdownMenuItem>
<DropdownMenuItem>Subscription</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</template>