@zedtech/zedkit-ui
Cycle a word in a clipped slot
Stable-height clipped slot with padded block axis so descenders and underline stay visible; outgoing glides up (`zk-word-roll-exit-up`), incoming uses the stan…
At a glance
- Who: Headlines or inline labels that rotate a single word without remount-only fades.
- What: Stable-height clipped slot with padded block axis so descenders and underline stay visible; outgoing glides up (
zk-word-roll-exit-up), incoming uses the standard appear contract (fade-upfrom below). - Use when: Cycling provider names, emphasis words, or short tokens next to static copy.
- Avoid when: Full sentences or list carousels — use content-specific layout. For scroll reveal only, use
data-reveal/data-animatewithout WordRoll. - See also: Reveal and react with motion on any element
Install
pnpm add @zedtech/zedkit-uiLatest: 2.0.1 (via changesets).
Example
import { Heading, WordRoll } from "@zedtech/zedkit-ui";
const words = ["Cursor", "Muse", "Claude"] as const;
<Heading level={1} typeRole="title" aria-label={`Set up in ${words.join(", ")}`}>
Set up in{" "}
<WordRoll words={words} value={words[0]} dwellMs={300} aria-hidden />
</Heading>Wraps: (none), data-animate="fade-up", AnimateObserver, observeAnimate
Accessibility
Treat the roll as decorative when the full phrase is provided via aria-label on the heading; set aria-hidden on WordRoll. Under reduced motion, prefer a static inclusive string instead of cycling.