Reveal
Scroll-triggered entrance with fade, slide, blur and scale variants, driven by a pluggable animation engine (css, motion or gsap).
pnpm dlx @glinui/cli@latest add revealWelcome back, Priya
Installation
pnpm dlx @glinui/cli@latest add revealPrefer the package?
Usage
Motion engine
// pnpm add motion (separate dependency, optional)// Once at your app entry:import "@glinui/motion/register/motion"
import { Reveal } from "@glinui/ui"
export function Demo() { return ( <Reveal engine="motion" variant="blur-slide" className="rounded-card border border-line-soft bg-surface-1 p-4"> Revealed when it scrolls into view. </Reveal> )}GSAP engine
// pnpm add gsap (separate dependency under GreenSock's own license, not bundled by GLINUI)// Once at your app entry:import "@glinui/motion/register/gsap"
import { Reveal } from "@glinui/ui"
export function Demo() { return ( <Reveal engine="gsap" variant="blur-slide" className="rounded-card border border-line-soft bg-surface-1 p-4"> Revealed when it scrolls into view. </Reveal> )}Static (animations off)
import { Reveal } from "@glinui/ui"
export function Demo() { return ( <Reveal motion="none" variant="blur-slide" className="rounded-card border border-line-soft bg-surface-1 p-4"> Revealed when it scrolls into view. </Reveal> )}Accessibility
- Content is in the DOM and visible to assistive tech before and after the animation.
- Animation never gates meaning: the static state is identical to the final animated state.
Reduced Motion
Under prefers-reduced-motion the engine drops travel, blur and scale and only fades opacity. motion="none" renders the final state immediately and never loads an animation library.
Affected properties
opacitytransformfilterAPI Reference
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
as | RevealTag | No | "div" | Element to render. |
variant | RevealVariant | No | "slide" | Visual treatment of the reveal. |
direction | RevealDirection | No | "up" | Direction the content travels in. |
distance | number | No | 16 | Travel distance in px for slide variants. |
duration / delay | number | - | - | Milliseconds. Duration defaults to 520 or the spring settling time. |
spring | SpringInput | No | - | Spring preset name or custom physics. Uses real physics on the motion and gsap engines. |
once | boolean | No | true | Only animate the first time it enters the viewport. |
threshold | number | No | 0.15 | Visible fraction required to trigger. |
immediate | boolean | No | false | Play on mount instead of waiting for the viewport. |
engine | EngineName | No | "css" | Animation engine. css is built in with zero dependencies; motion and gsap are opt-in (import "@glinui/motion/register/<name>" and install the package). Falls back to MotionEngineProvider, then data-glin-engine on <html>, then css. |
motion | MotionLevel | No | "system" | none renders the final state with no animation, subtle animates opacity only, system follows prefers-reduced-motion. |
children | React.ReactNode | No | - | Auto-generated from TypeScript source. |
delay | number | No | - | Delay in ms. |
duration | number | No | - | Duration in ms. Defaults to the engine default (520). |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Import
import { Reveal } from "@glinui/ui"Source Files
Dependencies
@glinui/ui@glinui/motionGenerated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/reveal.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
RevealProps
EngineControlProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
engine | EngineName | No | - | Engine override: `css` (default), `motion`, `gsap` or a registered custom engine. |
motion | MotionLevel | No | - | Motion override. `none` renders the static final state, `subtle` is opacity only. |
RevealProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
as | RevealTag | No | "div" | - |
children | React.ReactNode | No | - | - |
delay | number | No | - | Delay in ms. |
direction | RevealDirection | No | - | Direction the content travels in. Default `up`. |
distance | number | No | - | Travel distance in px for slide variants. |
duration | number | No | - | Duration in ms. Defaults to the engine default (520). |
engine | EngineName | No | - | Engine override: `css` (default), `motion`, `gsap` or a registered custom engine. |
immediate | boolean | No | false | Play on mount instead of waiting for the viewport. |
motion | MotionLevel | No | - | Motion override. `none` renders the static final state, `subtle` is opacity only. |
once | boolean | No | true | Animate only the first time it enters the viewport. Default true. |
spring | SpringInput | No | - | - |
threshold | number | No | - | Visible fraction (0 to 1) required to trigger. Default 0.15. |
variant | RevealVariant | No | "slide" | - |