Componentmedia0.43 KB gzipZero dependencies

Reveal

IntersectionObserver: children animate in when entering viewport with fade-up/scale variants, delay prop, once re-trigger option.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add reveal

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Reveal } from "@/components/ui/reveal" <Reveal delay={0}>Content animates when scrolling into view</Reveal>

Source code

reveal.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxreveal.tsx53 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type RevealProps = {  children?: React.ReactNode;  /** Staggered entrance delay multiplier (index * 40 in ms) */  delay?: number;  /** Only trigger once on first visible appearance */  once?: boolean;} & React.HTMLAttributes<HTMLElement>; export function Reveal({ children, delay = 0, once = true, ...props }: RevealProps) {  const containerRef = React.useRef<HTMLDivElement>(null);  const [visible, setVisible] = React.useState(false);   React.useEffect(() => {

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { Reveal } from "@/components/ui/reveal"; <Reveal />
PropTypeDescription
childrenReact.ReactNodeChild elements rendered inside the component.
delaynumberStaggered entrance delay multiplier (index * 40 in ms)
oncebooleanOnly trigger once on first visible appearance