Fade
FadeOne prop-driven fade — opacity plus an optional subtle drift (direction) and blur focus-in (blur), on inView or mount. Covers above-the-fold fades and scroll reveals alike.
Installation
One command drops the source into your repo — editable, with the provider and motion pulled in automatically.
npx shadcn add https://motion.asmitsah.dev/r/fade.jsonThis component imports from @/lib/motion and needs <MotionProvider> mounted in your root layout — install the base once, before copying this component.
npx shadcn add https://motion.asmitsah.dev/r/provider.jsonnpm install motioncomponents/motion/fade.tsxUsage
Basic
Wrap anything — it fades in with a subtle upward drift. Already-in-view elements animate immediately, so this covers both above-the-fold and on-scroll.
Scroll reveal
The default trigger is inView (once) — so a Fade below the fold rises in the first time it scrolls into view. This is the migration path off the old Reveal.
Pure opacity
direction="none" drops the drift for a straight opacity fade — the old FadeIn.
Blur focus-in
blur layers a blur → sharp settle on top of the fade (GPU-costly `filter` — opt-in). Since direction defaults to "up", a bare `<Fade blur>` also rises — use direction="none" for a pure focus-in with no movement.
On mount + delay
trigger="mount" plays immediately regardless of viewport; delay offsets a sibling to sequence a hero without a full Stagger.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | — | Content that fades in. |
| className | string | — | Passed straight through — Fade becomes your layout element. |
| style | CSSProperties | — | Inline style passthrough. |
| delay | number | 0 | Seconds before this instance animates. |
| direction | "none" | "up" | "down" | "left" | "right" | "up" | A fixed, subtle drift as it fades — "none" is pure opacity. Tunable travel is Slide's job. |
| blur | boolean | number | false | Layer a blur → sharp focus-in on top; true uses ~8px, a number sets custom px. |
| trigger | "inView" | "mount" | "inView" | Animate the first time it's in view (once), or immediately on mount. |