fade-out
remotionui/fade-outFreeComponent
Held exit that accelerates away, timed to the last frame of its sequence by default
Live preview
live · rendered by the registry
Rendered by remotionui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://remotionui.com/r/fade-out.jsonSource
1import type { CSSProperties, ReactNode } from "react";2import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";3import { MotionWrapper } from "@/remotion/lib/motion-wrapper";4import { EASING_EXIT } from "@/remotion/lib/timing";56export type FadeOutProps = {7 children: ReactNode;8 /** Length of the fade in frames. */9 durationInFrames?: number;10 /**11 * Frame the fade starts on. Left out, it lands on the last frame of the12 * surrounding `<Sequence>` — the usual intent, and one less number to keep13 * in sync when the window changes.14 */15 delayInFrames?: number;16 /** Opacity it holds before the fade. */17 from?: number;18 /** Opacity it ends on. */19 to?: number;20 block?: boolean;21 style?: CSSProperties;22 className?: string;23};2425/**26 * Holds, then leaves on an ease-in curve — an exit accelerates away, it never27 * decelerates into nothing.28 */29export const FadeOut: React.FC<FadeOutProps> = ({30 children,31 durationInFrames = 30,32 delayInFrames,33 from = 1,34 to = 0,35 block,36 style,37 className,38}) => {39 const frame = useCurrentFrame();40 const { durationInFrames: windowFrames } = useVideoConfig();4142 const duration = Math.max(1, Math.round(durationInFrames));43 const start =44 delayInFrames ??45 (Number.isFinite(windowFrames) ? Math.max(0, windowFrames - duration) : 0);4647 const opacity = interpolate(frame, [start, start + duration], [from, to], {48 easing: EASING_EXIT,49 extrapolateLeft: "clamp",50 extrapolateRight: "clamp",51 });5253 return (54 <MotionWrapper block={block} className={className} style={{ ...style, opacity }}>55 {children}56 </MotionWrapper>57 );58};
More from remotionui
All 127 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| audio-pulseaudio-pulse | remotionui | Components | Free | no deps | |
| audiogram-barsaudiogram-bars | remotionui | Components | Free | no deps | |
| blur-focus-inblur-focus-in | remotionui | Components | Free | no deps | |
| blur-inblur-in | remotionui | Components | Free | no deps | |
| blur-revealblur-reveal | remotionui | Components | Free | no deps | |
| caption-highlightcaption-highlight | remotionui | Components | Free | no deps | |
| chromatic-aberration-wipechromatic-aberration-wipe | remotionui | Components | Free | no deps | |
| confetti-burstconfetti-burst | remotionui | Components | Free | no deps |
