ComponentsEffects
Sliding text
A value that slides horizontally into place when it changes
Draft
Installation
nub add @gpuixui/componentsUsage
import { SlidingText } from "@gpuixui/fx/sliding-text";
<div style={{ width: 220 }}>
<SlidingText text={status} role="bodyStrong" />
</div>;API
| Prop | Type | Default |
|---|---|---|
text | string | — |
direction | "forward" | "back" | "forward" |
level | MotionLevel | "normal" |
role | TextRole | "body" |
className | string | — |
style | StateStyle<SlidingTextState> | — |
A value that keeps changing
The swap is timed from the exit the change started, not from the newest value: a value arriving mid-exit replaces the pending one, and the window is the exit half of level, so a live counter — a value updated faster than one swap — still commits a swap every window and shows a newer value instead of emptying the clip. Once the changes stop, the last value is the one that paints.
Under MotionProvider preference="reduced" the swap is immediate, so there is no window to wait.
Edit this page on GitHubpackages/fx/docs/sliding-text.mdx