Blur

An entrance that resolves from blur to sharp.

Available inAvailable in React, Vue, Svelte, Solid, JavaScript· All five frameworks
PrequelUI

Libraries

PrequelUI

Motion

Spring + short tween

Reduced motion

Fade in place
blur.tsx
Play with the real component, then read the code it ships with.All components
01

Installation

Installing for React·components/prequelui/effects/blur.tsx

Add the component

npx shadcn@latest add https://prequeluianimate.terravidhal.me/r/blur.json
npmthe default on every machine

First component? Set up your project first

Frameworks

The live preview is React. Each tab below is the file that ships for that framework, with the same durations, springs and reduced-motion rule.

5 runtimes
blur.tsx
"use client";

import * as React from "react";
import { motion, type HTMLMotionProps, type Transition } from "motion/react";
import { Slot, useReduceMotion, useTempoTransition } from "../motion";
import { entranceSpring, useInViewEffect } from "./shared";

export type BlurProps = HTMLMotionProps<"div"> & {
  children?: React.ReactNode;
  delay?: number;
  initialBlur?: number;
  blur?: number;
  inView?: boolean;
  inViewOnce?: boolean;
  inViewMargin?: string;
  transition?: Transition;
  asChild?: boolean;
};

export function Blur({
  children,
  delay = 0,
  initialBlur = 10,
  blur = 0,
  inView = false,
  inViewOnce = true,
  inViewMargin = "0px",
  transition,
  asChild = false,
  ...props
}: BlurProps) {
  const reduce = useReduceMotion();
  const ref = React.useRef<HTMLDivElement>(null);
  const visible = useInViewEffect(ref, inView, inViewOnce, inViewMargin);
  const base = useTempoTransition(transition ?? entranceSpring);
  const Component = (asChild ? Slot : motion.div) as React.ElementType;

  return (
    <Component
      ref={ref}
      data-slot="blur"
      initial="hidden"
      animate={visible ? "visible" : "hidden"}
      exit="hidden"
      variants={{
        hidden: { filter: `blur(${reduce ? 0 : initialBlur}px)` },
        visible: { filter: `blur(${blur}px)` },
      }}
      transition={{
        ...base,
        delay: (base.delay ?? 0) + delay / 1000,
      }}
      {...props}
    >
      {children}
    </Component>
  );
}

export type BlurListProps = Omit<BlurProps, "children"> & {
  children: React.ReactElement | React.ReactElement[];
  holdDelay?: number;
};

export function Blurs({
  children,
  delay = 0,
  holdDelay = 0,
  ...props
}: BlurListProps) {
  return (
    <>
      {React.Children.toArray(children).map((child, index) => (
        <Blur key={index} delay={delay + index * holdDelay} {...props}>
          {child as React.ReactElement}
        </Blur>
      ))}
    </>
  );
}

Install

npx shadcn@latest add https://prequeluianimate.terravidhal.me/r/blur.json
npmthe default on every machine

Dependencies

motion lucide-react

The registry keeps the component source, its motion tokens and the reduced-motion branch together, so the install never pulls a different animation from the preview.

02

Usage

Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.

blur.tsx
import { Blur } from "@/components/prequelui/effects/blur";

export default function Demo() {
  return (
    <Blur initialBlur={12} blur={0} delay={100} className="text-4xl font-medium">
      From soft to sharp.
    </Blur>
  );
}
import { Blur } from "@/components/prequelui/blur";

export function Variant() {
  return (
    <Blur tempo={1.2}>
      …
    </Blur>
  );
}
03

Animation

The element starts with a filter and resolves to sharp on the entrance spring. Nothing moves: only the blur radius changes, so the layout and the text metrics are untouched.

  • Entrance spring: stiffness 200, damping 20.
  • Delay is expressed in milliseconds and added to the transition delay.
  • The list variant staggers each child by the holdDelay value.
  • Reduced motion starts at blur 0.
spring 200 / 20blur 10 → 0delay in msstaggered list
04

API Reference

Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.

Blur

PropTypeDefault
initialBlurnumber10
blurnumber0
delaynumber0
inViewbooleanfalse
inViewOncebooleantrue
inViewMarginstring"0px"
transitionTransitioncomponent spring or tween
asChildbooleanfalse
classNamestring—

Blurs

PropTypeDefault
holdDelaynumber0
childrenReactElement[]—

Next component

Click

A ring, ripple, crosshair or burst played at the click point.