Presets

CSS animation fade in

An element that fades from transparent to visible, optionally coming into focus from a blur.

CSSTailwindReactGIFMP4
Hello, I faded in.
00.000 / 0.800s
timing
style

npm i motion · the component uses motion/react

How it works

This fade in animation brings an element from fully transparent to fully visible once, with an optional blur that sharpens as it appears. The blur version reads as "coming into focus" and works well for hero text, images and modals.

The fade keyframe animates opacity from 0 to 1 and filter from blur(Start blur px) to blur(0). It runs a single iteration with fill-mode both: the 0% state applies during the Delay, so the element stays invisible until its turn, and the 100% state remains after the animation ends instead of snapping back.

Parameters: Width (for the demo block), Start blur, Duration, Delay and Easing. Set Start blur to 0 for a classic opacity-only fade. 4 to 10px of blur is noticeable without smearing the content into an unreadable smudge. 0.5 to 0.8s with ease-out feels responsive. Use Delay to sequence several elements: a heading at 0s, subtext at 0.15s, buttons at 0.3s.

Opacity alone is the cheapest property to animate. Blur is GPU-accelerated in modern browsers but scales with the area being blurred, so on full-screen images keep the duration short or skip the blur on low-end devices. For a fade out, play the same keyframe in reverse. Content hidden at opacity 0 is still in the accessibility tree, so screen reader users are not affected by the delay.

How do I make a fade in and fade out animation in CSS?

For fade out, apply the same keyframe with animation-direction: reverse, or write a second keyframe from opacity 1 to 0. If the element should leave the layout afterwards, listen for animationend and then set display: none or remove it. In React, Motion's AnimatePresence with an exit prop handles this for you.

Why does the element stay hidden during the delay?

The animation uses fill-mode both. During the delay the first keyframe (opacity 0, blurred) is already applied, which prevents a flash of the visible element before the fade starts. After the animation, the last keyframe stays applied. Without both, you would see the element appear, vanish, then fade in.

How do I fade in an element when it scrolls into view?

Use the Reveal on scroll preset, which starts the animation the first time the element enters the viewport. The CSS output includes a short IntersectionObserver script that adds an is-inview class, and the React version uses Motion's whileInView. You can set its rise to 0 and start scale to 1 for a pure fade.

relatedMore like this

all entrance →
Item 1 Item 2 Item 3
01 Slide up once
Sliding in.
02 Slide in once
I appear when scrolled into view.
03 Reveal on scroll inview
04 Animated gradient background loop
Hello, world!
05 Typewriter effect loop
06 3D press button press

Export

format
height

480p max · small watermark · 3 per day · remove limits