Skip to content

🎥 Make videos programmatically with React

Update fade.mdx

Jonny Burgera726ac2a199b
diff --git a/packages/docs/docs/transitions/presentations/fade.mdx b/packages/docs/docs/transitions/presentations/fade.mdx
index f64ceefe74..c4d431dfb3 100644
--- a/packages/docs/docs/transitions/presentations/fade.mdx
+++ b/packages/docs/docs/transitions/presentations/fade.mdx
@@ -3,6 +3,61 @@ crumb: "@remotion/transitions - Presentations"
title: "fade()"
---
-fade
+A simple fade animation. The incoming slide fades in over the outgoing slide, while the outgoing slide does not change. Works only if the incoming slide is fully opaque..
<Demo type="fade" />
+
+## Example
+
+```tsx twoslash title="FadeTransition.tsx"
+import { AbsoluteFill } from "remotion";
+
+const Letter: React.FC<{
+ children: React.ReactNode;
+ color: string;
+}> = ({ children, color }) => {
+ return (
+ <AbsoluteFill
+ style={{
+ backgroundColor: color,
+ opacity: 0.9,
+ justifyContent: "center",
+ alignItems: "center",
+ fontSize: 200,
+ color: "white",
+ }}
+ >
+ {children}
+ </AbsoluteFill>
+ );
+};
+// ---cut---
+import { linearTiming, TransitionSeries } from "@remotion/transitions";
+import { fade } from "@remotion/transitions/fade";
+
+const BasicTransition = () => {
+ return (
+ <TransitionSeries>
+ <TransitionSeries.Sequence durationInFrames={40}>
+ <Letter color="#0b84f3">A</Letter>
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Transition
+ presentation={fade()}
+ timing={linearTiming({ durationInFrames: 30 })}
+ />
+ <TransitionSeries.Sequence durationInFrames={60}>
+ <Letter color="pink">B</Letter>
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+ );
+};
+```
+
+## API
+
+This API has no options.
+
+## See also
+
+- [Source code for this presentation](https://github.com/remotion-dev/remotion/blob/main/packages/transitions/src/presentations/fade.tsx)
+- [Presentations](/docs/transitions/presentations)