Blur Reveal
Installation
npx shadcn@latest add https://uibrik.com/r/blur-reveal.jsonInstall the packages
npm install motionCopy the source into your project
components/uibrik/blur-reveal/blur-reveal.tsx"use client"; import { motion } from "motion/react"; import { EASE_OUT, TEXT, glyph, type EffectProps } from "../_text-effects/shared"; // 03 — A blur travels left to right across the line: each character // fades in from soft to sharp a beat after the one before it. export function BlurReveal({ play, text = "Coming into focus", duration = 0.4, stagger = 0.03, blur = 8, }: EffectProps & { text?: string; /** Seconds each character takes to sharpen. */ duration?: number; /** Seconds between characters. */ stagger?: number; /** Starting blur in px. */ blur?: number; }) { return ( <p className={TEXT} aria-label={text}> {Array.from(text).map((ch, i) => ( <motion.span key={`${play}-${i}`} aria-hidden className="inline-block" initial={play ? { opacity: 0, filter: `blur(${blur}px)` } : false} animate={{ opacity: 1, filter: "blur(0px)" }} transition={{ duration, delay: i * stagger, ease: EASE_OUT }} > {glyph(ch)} </motion.span> ))} </p> ); }
Adds the files to
components/uibrik/blur-reveal and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/blur-reveal.Props
BlurReveal- text
- Type string
- "Coming into focus"
- The copy to animate.
- duration
- Type number
- 0.4
- Time for each character to sharpen.
- stagger
- Type number
- 0.03
- Delay between characters.
- blur
- Type number
- 8
- Starting blur.
- playrequired
- Type number
- –
- Each change plays the effect again; 0 shows its resting state.