Account

Typography

Creative

Sliding 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.

Terminal
npx @galactrex/ui add sliding-text

Usage

Example
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.

See plans

Props

PropTypeDefaultDescription
textstring—The text.
asElementType"span"Element.
trigger"mount" | "inView" | "hover" | "manual""hover"When it plays.
activeboolean—Plays when true, for trigger="manual".
staggernumber0.018Seconds between letters.
direction"up" | "down""up"Travel.
classNamestring—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.