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
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add revealOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Reveal } from "@/components/ui/reveal" <Reveal delay={0}>Content animates when scrolling into view</Reveal>Source code
reveal.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| children | React.ReactNode | Child elements rendered inside the component. |
| delay | number | Staggered entrance delay multiplier (index * 40 in ms) |
| once | boolean | Only trigger once on first visible appearance |