Una pausa, justo aquí.

Este contenido aparece al entrar en el área visible.

React + MotionText & scroll

Reveal on scroll

A section that fades in and slides up gently as it enters the screen.

Settings

28px

Code

import { motion } from "framer-motion";

const spring = { type: "spring" as const, stiffness: 300, damping: 30 };

interface ScrollRevealProps {
  distance?: number;
  /** true: caja de demo con scroll propio. false: solo la sección, que aparece con el scroll de la página. */
  contained?: boolean;
}

export default function ScrollReveal({
  distance = 28,
  contained = true,
}: ScrollRevealProps) {
  // whileInView observa el viewport y tiene en cuenta el recorte del contenedor, así sirve en ambos modos.
  const section = (
    <motion.div
      initial={{ opacity: 0, y: distance }}
      whileInView={{ opacity: 1, y: 0 }}
      viewport={{ once: false, amount: 0.6 }}
      transition={spring}
      className="rounded-[22px] bg-white dark:bg-[#1c1c1e] p-6 text-[#1d1d1f] dark:text-[#f5f5f7] shadow-[0_1px_2px_rgba(0,0,0,0.03),0_8px_28px_rgba(0,0,0,0.05)]"
    >
      <h3 className="text-lg font-semibold sm:text-xl">A pause, right here.</h3>
      <p className="mt-2 text-sm text-[#86868b]">This content appears as it scrolls into view.</p>
    </motion.div>
  );

  if (!contained) return section;

  return (
    <div className="h-60 w-full overflow-y-auto rounded-2xl bg-black/5 p-5 dark:bg-white/10">
      <div className="h-24" />
      {section}
      <div className="h-32" />
    </div>
  );
}

Prompt for AI

Paste it into ChatGPT, Claude or Cursor and it will adapt the block to your project with these settings, even if you don’t use React.

More in Text & scroll

Where to use it

A soft reveal on scroll gives long pages a sense of rhythm, as if each part arrives when you reach it. It suits the steps of a “How it works” section, the testimonials of a coaching site or a long sales page. Done this subtly, a fade in on scroll animation supports the reading instead of interrupting it.

Keep the distance small, 20 to 30 pixels; bigger jumps feel like the page is loading late. Do not apply it to every paragraph. Reveal whole sections, and leave the first screen static so nothing is hidden when the page opens.