下拉菜单

New

可组合的动效下拉菜单:面板从触发器近角弹簧展开并带视口碰撞翻转;hover 与键盘共用一块在行间滑动的焦点表面;支持分组标签、图标+双行描述+快捷键、勾选项、悬停/方向键子菜单,以及完整的键盘循环导航。

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/dropdown-menu

API 参考

DropdownMenu

open?
boolean
defaultOpen?
boolean
false
onOpenChange?
((open: boolean) => void)
className?
string

DropdownMenuTrigger

className?
string

DropdownMenuContent

align?
"end" | "start" | "center"
start
className?
string

DropdownMenuLabel

className?
string

DropdownMenuSeparator

className?
string

DropdownMenuItem

icon?
ReactNode
description?
string
shortcut?
string
disabled?
boolean
false
destructive?
boolean
false
onSelect?
(() => void)
className?
string

DropdownMenuCheckboxItem

checked
boolean
onCheckedChange
(checked: boolean) => void
disabled?
boolean
false
className?
string

DropdownMenuSub

className?
string

DropdownMenuSubTrigger

icon?
ReactNode
className?
string

DropdownMenuSubContent

className?
string

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.