Typography
CreativeSliding Text
Every letter slides out and an identical one slides in behind it, one after another. For links, nav items and buttons.
Install
Included with Creative: needs your API key. Initialize and log in once.
npx @galactrex/ui add sliding-textUsage
import { SlidingText } from "@/components/galactrex/sliding-text";
<a href="/work/"><SlidingText text="Work" /></a>Source
Installs to components/galactrex/sliding-text.tsx, with the shared motion primitives beside it.
Source for this component comes with its plan. Install it with the command above, or open your licensed copy here.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | — | The text. |
as | ElementType | "span" | Element. |
trigger | "mount" | "inView" | "hover" | "manual" | "hover" | When it plays. |
active | boolean | — | Plays when true, for trigger="manual". |
stagger | number | 0.018 | Seconds between letters. |
direction | "up" | "down" | "up" | Travel. |
className | string | — | Extra classes for the outer element. |
Variants
- Nav link. Hover roll on menu items.
- Entrance. Any other trigger rolls it in once.
Accessibility
- Real text read once.
Motion and reduced motion
- Transforms inside clipped letter slots.
- Reduced motion: no roll.