Skip to content

Instantly share code, notes, and snippets.

@bonrow
Created January 19, 2026 09:59
Show Gist options
  • Select an option

  • Save bonrow/e929ee5eb3b612d550fb72b820ca7e51 to your computer and use it in GitHub Desktop.

Select an option

Save bonrow/e929ee5eb3b612d550fb72b820ca7e51 to your computer and use it in GitHub Desktop.
A portable react component to render a blurry fade-in from bottom animation, using motion/react
"use client";
import { motion, type Transition, type Variants } from "motion/react";
import type React from "react";
const fadeVariants = Object.freeze({
hidden: { opacity: 0, y: 15, filter: "blur(3px)" },
shown: { opacity: 1, y: 0, filter: "blur(0)" },
}) satisfies Variants;
const fadeTransition = Object.freeze({
type: "spring",
bounce: 0,
duration: 1,
}) satisfies Transition;
export function BlurryFadeInWrapper({
delay,
...restProps
}: React.ComponentProps<typeof motion.div> & {
/* Alternative to staggerChildren */
delay?: number;
}) {
return (
<motion.div
key="greeting"
variants={fadeVariants}
transition={{ ...fadeTransition, delay }}
initial="hidden"
animate="shown"
{...restProps}
/>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment