🎥 Make videos programmatically with React
documentation for GIF component
Jonny Burgerbbef9abc46ce
diff --git a/packages/docs/docs/get-input-props.md b/packages/docs/docs/get-input-props.mdindex 5a0a3aa2c3..780d1c6ff6 100644--- a/packages/docs/docs/get-input-props.md+++ b/packages/docs/docs/get-input-props.md@@ -3,6 +3,10 @@ title: getInputProps()id: get-input-props---+:::warning+This component is part of Remotion 2.0 which is not yet released. The information on this page might not yet accurately reflect the current state of Remotions API.+:::warning+_Available from v2.0_.Using this method, you can retrieve inputs that you pass in from the command line using [`--props`](/docs/cli), or the [`inputProps`](/docs/ssr#render-a-video-programmatically) parameter if you are using the Node.JS API.diff --git a/packages/docs/docs/gif.md b/packages/docs/docs/gif.mdnew file mode 100644index 0000000000..257094544e--- /dev/null+++ b/packages/docs/docs/gif.md@@ -0,0 +1,72 @@+---+id: gif+sidebar_label: Reference - @remotion/gif+title: "@remotion/gif"+---++:::warning+This component is part of Remotion 2.0 which is not yet released. The information on this page might not yet accurately reflect the current state of Remotions API.+:::warning++You can install this package from NPM to get a component for displaying GIFs that synchronize with Remotions [`useCurrentFrame()`](use-current-frame).++```console+npm i @remotion/gif+```++## Props++### `src`++_required_++The source of the GIF. Can be an URL or a local image - see [Importing assets](assets).++### `width`++The display width.++### `height`++The display height.++### `fit`++Must be one of these values:++- `'fill'`: The GIF will completely fill the container, and will be stretched if necessary. (_default_)+- `'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.++### `onLoad`++Callback that gets called once the GIF has loaded and finished processing. As its only argument, the callback gives the following object:++- `loaded`: Will be always `true`.+- `width`: Width of the GIF file in pixels.+- `height`: Height of the GIF file in pixels.+- `delays`: Array of timestamps of type `number` containing position of each frame.+- `frames`: Array of frames of type [`ImageData`](https://developer.mozilla.org/en-US/docs/Web/API/ImageData)++### `style`++Allows to pass in custom CSS styles.++## Example++```tsx+import {Gif} from '@remotion/gif';++export const MyComponent: React.FC = () => {+ const {width, height} = useVideoConfig();++ return (+ <Gif+ src="https://media.giphy.com/media/3o72F7YT6s0EMFI0Za/giphy.gif"+ width={width}+ height={height}+ fit="fill"+ />+ )+}+```diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 6d3b61401b..bec5e765be 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -31,7 +31,7 @@ module.exports = {},{type: "category",- label: "Reference",+ label: "Reference - Core API",items: ["cli","config",@@ -54,6 +54,7 @@ module.exports = {"easing",],},+ "gif","license",],};