Default
Point at it and it stops; so does Tab. The round button pauses it for good.
A ticker written on a strip of washi tape. The text runs along it, fades at the ends, stops while you point at it or focus inside it, and has a pause button. With reduced motion it is a still strip with the text centered.
npx shadcn@latest add @wobko/marquee第一次使用?先把 registry 加进 components.json。 如何安装
Point at it and it stops; so does Tab. The round button pauses it for good.
Any tape from the desk: masking, striped, gingham. direction="end" runs it the other way, speed sets px per second. (washi-dots is for short, large words: its white dots are as big as small letters.)
A real use: the strip above a site header, with links in it. Only the first copy can be tabbed to, and the ticker holds still while a link has focus.
The band: a strip of the engine's tape drawn to the width of the box, with the moving text in a clipped, edge-faded viewport. It repeats its content just enough times to fill the band and loops seamlessly with a CSS animation (keyframes come with the component).
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| speed | number | 60 | px per second. A short text is never slower than a 4 second loop. |
| direction | "start" | "end" | "start" | Toward the start of the line (like a news ticker, mirrored in right-to-left) or away from it. |
| tape / color | TapeKind / Accent | "washi-stripes" | masking, washi-dots, washi-stripes, washi-zigzag, washi-gingham, kraft or clear; color is the print of a washi. `washi-dots` has white dots as big as small letters: keep it for short, large words and put customer names on `washi-gingham`, `washi-stripes` or `masking`. |
| paused / defaultPaused / onPausedChange | boolean | - | Controlled or uncontrolled pause. Hover and keyboard focus pause it as well. |
| controls | boolean | true | The pause button. Leave it on for any ticker that runs more than five seconds. |
| label | string | "Ticker" | Accessible name (role="marquee"). |
One phrase, followed by a small hand-drawn star. Pass `separator` for your own glyph, or `false` for none.
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| separator | ReactNode | false | - | What comes after the phrase. |
CLI 会复制进你项目的文件。
正在加载源码