星光描边

New

一束缓慢的光沿按钮或卡片边框环绕运行——纯 CSS 锥形渐变包裹器,可调光色、速度与描边厚度。「减少动效」偏好下静止为固定描边。

Featured

Pro plan

A slow light circles the card.

安装

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

$ bunx --bun shadcn add @uilab/star-border

API 参考

children
ReactNode

Content the light ring wraps. Needs no background of its own — the ring is cut to the border band.

className?
string
color?
string

Color of the traveling light. Defaults to the current text color, so it follows whatever `text-*` class is set on the wrapper.

currentColor
speed?
number

Seconds for one full revolution around the border.

6
thickness?
number

Border ring thickness in px.

1
startAngle?
number

Where the comet sits at time zero, in degrees. Vary it across instances so several rings on one screen don't travel in lockstep.

0

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.