Scroll Reveal
Scroll Reveal brings controlled expression to your interface.
Make it yours.
Install the editable source and its dependencies into your React + Tailwind project.
Scroll horizontally for long lines
pnpm dlx shadcn@4.0.8 add http://localhost:3000/r/scroll-reveal.jsonUse it
Scroll horizontally for long lines
"use client";
import {ScrollReveal} from '@/components/jez-ui/ui/scroll-reveal';
import {Card} from '@/components/jez-ui/ui/card';
export default function Example(){
return <><ScrollReveal><Card><h3 className="text-3xl">Here when you arrive.</h3></Card></ScrollReveal></>;
}Props & types
Scroll horizontally for long lines
HTMLMotionProps<"div">Source
View 2 source files
registry/ui/scroll-reveal.tsx
Scroll horizontally for long lines
"use client";
import * as React from "react";
import { cn } from "./utils";
import { motion, useReducedMotion, type HTMLMotionProps } from "motion/react";
export function ScrollReveal({
className,
children,
...props
}: HTMLMotionProps<"div">) {
const reduce = useReducedMotion();
return (
<motion.div
initial={reduce ? false : { y: 28, opacity: 0.3 }}
whileInView={{ y: 0, opacity: 1 }}
viewport={{ once: true, amount: 0.2 }}
transition={{ duration: 0.6, ease: [0.16, 1, 0.3, 1] }}
className={cn("", className)}
{...props}
>
{children}
</motion.div>
);
}
registry/ui/utils.ts
Scroll horizontally for long lines
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...values: ClassValue[]) {
return twMerge(clsx(values));
}
Dependencies
motion@13.2.0 · clsx@2.1.1 · tailwind-merge@3.5.0
Accessibility & behaviour
Respect reduced-motion preferences. Decorative effects must not carry essential information. WebGL scenes include a static fallback and only render while visible.
Read the accessibility and performance guide →