Updated
Fade In Left to Right
Revealed with a soft edge
Customize
Duration0.9s
Softness30%
Text size48px
Installation
npx shadcn@latest add https://uibrik.com/r/fade-left-to-right.jsonInstall the packages
npm install motionCopy the source into your project
components/uibrik/fade-left-to-right/fade-left-to-right.tsx"use client"; import { animate, motion, useMotionTemplate, useMotionValue } from "motion/react"; import { useEffect } from "react"; // `play` counts presses of a card's Change button. 0 means the card has not // been pressed yet, so every effect renders its resting state without // animating on page load. export type EffectProps = { play: number }; // Size comes from --text-effect-size (default 1.25rem, i.e. text-xl), so a // preview can enlarge every effect without changing the installed default. const SIZE = "text-[length:var(--text-effect-size,1.25rem)] leading-[1.4]"; const TEXT = `${SIZE} text-zinc-700 font-medium dark:text-zinc-200`; // 17 — The line is revealed by a soft edge that travels left to right, // fading the letters in rather than cutting them. export function FadeLeftToRight({ play, text = "Revealed with a soft edge", duration = 0.9, softness = 30, }: EffectProps & {
Adds the files to
components/uibrik/fade-left-to-right and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/fade-left-to-right.Usage
import { FadeLeftToRight } from "@/components/uibrik/fade-left-to-right/fade-left-to-right";<FadeLeftToRight play={0} text="Revealed with a soft edge" duration={0.9} softness={30}/>Where to use Fade In Left to Right
Hero taglines
A soft mask reading left to right matches how people read the line.
Scroll-revealed titles
A gentle wipe gives section headings an entrance without movement.
Pairs with Line-by-line Rise
Calm portfolio intros
A slow reveal suits minimal sites where motion should feel quiet.
Props
FadeLeftToRight- text
- Type string
- "Revealed with a soft edge"
- The copy to animate.
- duration
- Type number
- 0.9
- Time for the edge to cross the line.
- softness
- Type number
- 30
- Width of the soft edge.
- playrequired
- Type number
- –
- Each change plays the effect again; 0 shows its resting state.