文字解密

New

随机字符从左到右逐个解析为真实文本——进入视口、悬停或 text 变化时播放。解码过程中宽度不抖动,「减少动效」偏好下直接显示最终文本。

Hover to decodemotion, anything

安装

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

$ bunx --bun shadcn add @uilab/text-scramble

API 参考

text
string

The real text. Changing it plays a scramble decode from the old value to the new one.

trigger?
"view" | "hover"

"view" decodes once on scroll into view (default). "hover" replays on pointer hover; touch devices fall back to "view".

view
duration?
number

Total decode time in ms.

700
charset?
string

Glyphs shown while a character is still unresolved.

!<>-_\/[]{}=+*^?#
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.