共享布局背景块

借助 Framer Motion 的共享布局,让一枚胶囊背景块在悬停项之间平滑滑动,进出场带模糊过渡。

安装

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

$ bunx --bun shadcn add @uilab/shared-layout-bg

API 参考

className?
string
pillClassName?
string

Tailwind class applied to the moving pill. Defaults to a subtle foreground tint.

inset?
number

Horizontal inset of the pill relative to each row (px). Default 20.

20

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.