Reveal
Fades content in as it scrolls into view, and never hides what is already on screen.
Step 1
Apply
Step 2
Meet your mentor
Step 3
Build a project
Step 4
Present it
Step 5
Get placed
Step 6
Mentor others
Use Reveal to bring page sections in as people scroll to them. Press Replay above to watch the cards arrive. In your own page they play as the content scrolls into view. If your system is set to reduce motion, nothing animates and the content just appears.
Content is fully visible until the page has loaded, so it works without JavaScript and search engines see everything. Anything already on screen when the page loads is left alone, so there is no flash.
Installation
pnpm dlx shadcn@latest add https://components.abdulqadirmsingi.com/r/reveal.json
Usage
import { Reveal } from "@/components/ui/reveal";
<Reveal>
<h2>Our courses</h2>
</Reveal>
{/* Stagger siblings with small delays */}
{items.map((item, i) => (
<Reveal key={item.id} delay={i * 80}>…</Reveal>
))}Directions
from can be "up" (the default), "fade", "start" or "end". The last two slide sideways and flip in right-to-left layouts.
from="up"from="fade"from="start"from="end"Props
It extends the native <div> props and spreads them onto the element, including ref (React 19).
| Prop | Type | Default | Description |
|---|---|---|---|
| from | "up" | "fade" | "start" | "end" | "up" | How it arrives. |
| delay | number | 0 | Milliseconds to wait before starting. Use steps of 60 to 120 to stagger siblings. |
| threshold | number | 0.15 | The fraction of the element that must be visible before it reveals, from 0 to 1. |
| animateOnScreen | boolean | false | Also animate content that is already on screen at mount. Off by default, so the page doesn't flash on load. The demos on this page turn it on. |
| once | boolean | true | Reveal once, or hide again when it scrolls out of view. |
| as | ElementType | "div" | The element to render, for example "li" or "section". |
Accessibility
- It is only a visual effect. The content is in the page the whole time, in reading order, and screen readers read it whether or not it has appeared.
- It does nothing under
prefers-reduced-motion: the content just shows. - It only moves
opacityandtranslate, using the--duration-slowand--ease-outtokens. - Never put the only copy of something important, such as an error message, inside a
Reveal: it can be invisible for a moment while off screen.
Tokens used
--duration-slow, --ease-out.
Known limitations
- It watches the browser window, not a scrolling container inside the page.
- If the browser has no
IntersectionObserver, the content just shows. - Jumping past a section (the End key, an anchor link further down) shows it straight away, so nothing is left invisible behind you.