Fade
v1.0.1Updated 21 Jul 2026Cross-fades its child's opacity in and out based on the `in` prop, using a pure-CSS transition driven by inline styles. Supports per-instance duration, delay and easing, plus `unmountOnExit` to remove the child from the DOM after the exit transition finishes. Combine with a `delay` per item to stagger a list or grid entrance.
Preview
Live · 3 stories▸Why this is recommendedfadetransitionanimationopacity+4
Fade — demo.
- ✓Fading a panel in when a toggle is switched on
- ✓Staggering dashboard stat cards in on page load
- ✓Fading in an empty-state or loading message
- ✓Cross-fading between two pieces of inline content
- Opacity cross-fade on a boolean `in` prop
- Configurable duration / delay / easing per instance
- unmountOnExit removes the child from the DOM after exit
- Respects prefers-reduced-motion (snaps, no animation)
- data-state attribute (entering/entered/exiting/exited) for debugging
- Zero dependencies beyond React
- ✕Page-level route transitions (use a router-level transition)
- ✕Scroll-triggered reveals (use BlurFade with inView)
- ✕Animating size or layout (use Collapse)
Install
Ask your agent, or call the MCP tool directly. The resolved bundle is written into your project.
Usage
Tick variants in the left menu — each adds a tab with that variant’s real story source, the same code the preview above renders.
Props
inWhether the child is shown; drives the transition
yesdurationDuration in ms. Default 200
—delayDelay in ms before the transition starts. Default 0
—easingTiming function. Default 'ease-out'
—unmountOnExitRemove the child from the DOM after exit. Default false
—classNameExtra classes merged onto the wrapper element
—styleExtra inline styles; transition-driven properties take precedence
—refRef to the wrapper element (React 19 ref-as-prop)
—childrenContent to fade
yes