复制一段给 AI 编程工具的提示词,包含源码、依赖和用法
属性
WordRevealProps
同时支持以下类型的全部属性: Omit<React.ComponentProps<"p">, "children">
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| text* 必填 | string | — | The sentence to reveal |
| stagger | number | 70 | Delay between words in ms |
| duration | number | 700 | Duration of each word's transition in ms |
| blur | number | 8 | Blur radius in px before a word appears |
| offset | number | 14 | Vertical offset in px before a word appears |
| replayKey | number | string | — | Change this value to hide the words and play the reveal again |
| threshold | number | 0.4 | Fraction of the element that must be visible to start |
| once | boolean | true | Only play once. If false the words hide again when scrolled out of view |
安装
$ npx shadcn@latest add https://chromotion.dev/r/word-reveal.json