Skip to content

🎥 Make videos programmatically with React

Docs: Document `effects` prop (#8112)

Jonny Burgere4425ec6b66e
diff --git a/packages/docs/docs/animatedimage.mdx b/packages/docs/docs/animatedimage.mdx
index 6372961b36..46b149596a 100644
--- a/packages/docs/docs/animatedimage.mdx
+++ b/packages/docs/docs/animatedimage.mdx
@@ -48,6 +48,10 @@ Remote images need to support [CORS](https://developer.mozilla.org/en-US/docs/We
</details>
:::
+### `effects?`<AvailableFrom v="4.0.464" />
+
+Apply [effects](/docs/effects/api) to each frame after it has been drawn to the canvas.
+
### `width?`
The display width.
diff --git a/packages/docs/docs/canvasimage.mdx b/packages/docs/docs/canvasimage.mdx
index f5b6ec030e..3e66a309c2 100644
--- a/packages/docs/docs/canvasimage.mdx
+++ b/packages/docs/docs/canvasimage.mdx
@@ -33,6 +33,10 @@ The URL of the image. Can be a remote URL or a local file path from [`staticFile
Remote images need to support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) because the image is drawn onto a canvas.
+### `effects?`
+
+An array of Remotion [effects](/docs/effects/api) to apply to the image after it has been drawn to the source canvas.
+
### `width?`
The canvas width in pixels.
@@ -51,10 +55,6 @@ Must be one of these values:
- `'contain'`: The image is scaled to fit the canvas, while aspect ratio is maintained.
- `'cover'`: The image completely fills the canvas and maintains its aspect ratio. It will be cropped if necessary.
-### `effects?`
-
-An array of Remotion [effects](/docs/effects/api) to apply to the image after it has been drawn to the source canvas.
-
### `className?`
A class name to apply to the `<canvas>` element.
diff --git a/packages/docs/docs/effects.mdx b/packages/docs/docs/effects.mdx
index bd409f6777..586e22f64e 100644
--- a/packages/docs/docs/effects.mdx
+++ b/packages/docs/docs/effects.mdx
@@ -14,12 +14,13 @@ Pixels of canvas-based components can be manipulated using effects.
The following components support effects:
- [`<Solid>`](/docs/solid)
-- [`<HtmlInCanvas>`](/docs/html-in-canvas)
+- [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas)
- [`<Video>`](/docs/media/video)
- [`<Img>`](/docs/img)
- [`<CanvasImage>`](/docs/canvasimage)
- [`<AnimatedImage>`](/docs/animatedimage)
- [`<Gif>`](/docs/gif/gif)
+- [`<RemotionRiveCanvas>`](/docs/rive/remotionrivecanvas)
## Usage
diff --git a/packages/docs/docs/effects/index.mdx b/packages/docs/docs/effects/index.mdx
index 6dae3e747f..ac7b2e6e9f 100644
--- a/packages/docs/docs/effects/index.mdx
+++ b/packages/docs/docs/effects/index.mdx
@@ -7,12 +7,25 @@ title: '@remotion/effects'
# @remotion/effects<AvailableFrom v="4.0.464" />
-[Effects](/docs/effects) that can be applied to Remotion-based canvas components such as [`<Solid>`](/docs/solid), [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas), and [`<Video>`](/docs/media/video).
+[Effects](/docs/effects) that can be applied to Remotion-based canvas components.
import {TableOfContents} from './table-of-contents';
<Installation pkg="@remotion/effects" />
+## Supported components
+
+Pass effects through the `effects` prop of these components:
+
+- [`<Solid>`](/docs/solid)
+- [`<HtmlInCanvas>`](/docs/remotion/html-in-canvas)
+- [`<Video>`](/docs/media/video)
+- [`<Img>`](/docs/img)
+- [`<CanvasImage>`](/docs/canvasimage)
+- [`<AnimatedImage>`](/docs/animatedimage)
+- [`<Gif>`](/docs/gif/gif)
+- [`<RemotionRiveCanvas>`](/docs/rive/remotionrivecanvas)
+
## Effects
<TableOfContents />
diff --git a/packages/docs/docs/gif/gif.mdx b/packages/docs/docs/gif/gif.mdx
index 4656b58c31..cb286ea9bf 100644
--- a/packages/docs/docs/gif/gif.mdx
+++ b/packages/docs/docs/gif/gif.mdx
@@ -74,6 +74,10 @@ Must be one of these values:
- `'contain'`: The GIF is scaled to fit the box, while aspect ratio is maintained.
- `'cover'`: The GIF completely fills the container and maintains it's aspect ratio. It will be cropped if necessary.
+### `effects?`<AvailableFrom v="4.0.464" />
+
+Apply [effects](/docs/effects/api) to each GIF frame after it has been drawn to the canvas.
+
### `onLoad`
Callback that gets called once the GIF has loaded and finished processing. As its only argument, the callback gives the following object:
diff --git a/packages/docs/docs/media/video.mdx b/packages/docs/docs/media/video.mdx
index 7b03019df2..03f0fc54cc 100644
--- a/packages/docs/docs/media/video.mdx
+++ b/packages/docs/docs/media/video.mdx
@@ -66,6 +66,10 @@ For more information on HLS support, see the [HLS documentation](/docs/hls).
The URL of the video to be rendered. Can be a remote URL or a local file referenced with [`staticFile()`](/docs/staticfile).
+### `effects?`<AvailableFrom v="4.0.464" />
+
+Apply [effects](/docs/effects/api) to the video frame after it has been drawn to the canvas.
+
### `from?`<AvailableFrom v="4.0.445" />
At which frame this clip should start relative to the parent timeline. Default is `0`. Same meaning as [`from`](/docs/sequence#from) on [`<Sequence>`](/docs/sequence).
diff --git a/packages/docs/docs/remotion/html-in-canvas.mdx b/packages/docs/docs/remotion/html-in-canvas.mdx
index 7b7810048d..b59503a81b 100644
--- a/packages/docs/docs/remotion/html-in-canvas.mdx
+++ b/packages/docs/docs/remotion/html-in-canvas.mdx
@@ -92,6 +92,11 @@ Do not nest `<HtmlInCanvas>` inside another `<HtmlInCanvas>`. Nesting is not sup
<HtmlInCanvas> effects cannot be nested together. Chrome will only display the outer effect. Consider merging the effects into one if you can.
```
+### `effects?`<AvailableFrom v="4.0.464" />
+
+Apply [effects](/docs/effects/api) after the children have been painted to the canvas.
+If you also pass [`onPaint`](#onpaint), effects are applied after `onPaint` has finished drawing.
+
### `onPaint?`
Called when the children are updated and can be painted onto the canvas.
diff --git a/packages/docs/docs/rive/remotionrivecanvas.mdx b/packages/docs/docs/rive/remotionrivecanvas.mdx
index 1124f2647f..25961a7d0e 100644
--- a/packages/docs/docs/rive/remotionrivecanvas.mdx
+++ b/packages/docs/docs/rive/remotionrivecanvas.mdx
@@ -26,6 +26,10 @@ function App() {
a valid URL of the rive file to load. Can be a local file loaded using [`staticFile()`](/docs/staticfile) or a remote URL like `"https://cdn.rive.app/animations/vehicles.riv"`.
+### `effects?`<AvailableFrom v="4.0.464" />
+
+Apply [effects](/docs/effects/api) after the Rive animation has been drawn to the canvas.
+
### `fit?`
One of: `"contain" | "cover" | "fill" | "fit-height" | "none" | "scale-down" | "fit-width"`. Default is `"contain"`.
diff --git a/packages/docs/docs/solid.mdx b/packages/docs/docs/solid.mdx
index 757137a85b..f25800c560 100644
--- a/packages/docs/docs/solid.mdx
+++ b/packages/docs/docs/solid.mdx
@@ -31,6 +31,10 @@ Logical width of the canvas in pixels. Must be a positive integer.
Logical height of the canvas in pixels. Must be a positive integer.
+### `effects?`<AvailableFrom v="4.0.464" />
+
+Apply [effects](/docs/effects/api) after the rectangle has been painted to the canvas.
+
### `color?`
Fill color of the rectangle.
@@ -87,8 +91,7 @@ const MyComp = () => {
## What is this component for?
-This is mainly a component for adding effects to.
-Effects are an upcoming feature of Remotion - if you are here, you are early!
+This is mainly a component for adding [effects](/docs/effects/api) to a solid color.
## Compatibility