下拉选择器

New

可组合的下拉选择器,面板以弹性动画从触发器展开并分离,另提供 Morph 变体,通过共享布局让触发器直接生长为面板。

标准下拉选择器

select.tsx

由 Select、SelectTrigger、SelectValue、SelectContent、SelectItem 组成的可组合原语;面板从触发器上「掐断」分离,选项依次错落展开。可感知位置,必要时向上打开。

安装

$ bunx --bun shadcn add @uilab/select

API 参考

Select

value?
string
defaultValue?
string
onValueChange?
((value: string) => void)
disabled?
boolean
false
className?
string

SelectTrigger

className?
string

SelectValue

placeholder?
string
className?
string

SelectContent

className?
string

SelectItem

value
string
disabled?
boolean
false
className?
string

变形下拉选择器

select-morph.tsx

由 MorphSelect、MorphSelectTrigger、MorphSelectValue、MorphSelectContent、MorphSelectItem 组成;触发器通过共享 layoutId 直接变形为面板——始终是同一整块表面,展开与收起都不会分离。

安装

$ bunx --bun shadcn add @uilab/select-morph

API 参考

MorphSelect

value?
string
defaultValue?
string
onValueChange?
((value: string) => void)
disabled?
boolean
false
className?
string

MorphSelectValue

placeholder?
string
className?
string

MorphSelectTrigger

className?
string

MorphSelectContent

className?
string

MorphSelectItem

value
string
disabled?
boolean
false
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.