Blur Fade

Reveal content with a soft blur and fade, on mount or when scrolled into view.

Dependenciesmotion

Introducing

Balick UI

Components that feel as good as they look.

Installation#

pnpm dlx shadcn@latest add https://ui.balick.me/r/blur-fade.json

Or, with the namespace configured: @balick/blur-fade

Usage#

import { BlurFade } from "@/components/ui/blur-fade"

export function Hero() {
  return (
    <BlurFade delay={0.2} inView>
      <h1>Hello world</h1>
    </BlurFade>
  )
}

Props#

PropTypeDefault
duration

Animation duration in seconds.

number0.4
delay

Delay before the animation starts, in seconds.

number0
offset

Distance travelled by the element, in pixels.

number8
direction

Direction the element comes from.

"up" | "down" | "left" | "right""down"
blur

Amount of blur at the start of the animation.

string"6px"
inView

Wait until the element scrolls into view before animating.

booleanfalse
inViewMargin

Margin applied to the viewport when inView is set.

string"-50px"