Skip to content

🎥 Make videos programmatically with React

add docs

Jonny Burger34d628417bf7
diff --git a/packages/docs/docs/dynamic-metadata.md b/packages/docs/docs/dynamic-metadata.md
index 51e402413b..488032694e 100644
--- a/packages/docs/docs/dynamic-metadata.md
+++ b/packages/docs/docs/dynamic-metadata.md
@@ -83,3 +83,7 @@ export const Index: React.FC = () => {
)
}
```
+
+## See also
+
+- [`getInputProps()`](get-input-props)
diff --git a/packages/docs/docs/get-input-props.md b/packages/docs/docs/get-input-props.md
new file mode 100644
index 0000000000..5a0a3aa2c3
--- /dev/null
+++ b/packages/docs/docs/get-input-props.md
@@ -0,0 +1,30 @@
+---
+title: getInputProps()
+id: get-input-props
+---
+
+_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.
+
+You should whenever possible prefer to retrieve props directly in your composition, like you would read props from a component if you were to code a React application, but this method is useful if you want to retrieve the input props outside of a composition.
+
+## API
+
+Pass in a [parseable](/docs/cli) JSON representation using the `--props` flag to either `remotion preview` or `remotion render`:
+
+```console
+npx remotion render --props='{"hello": "world"}' src/index.tsx my-composition out.mp4
+```
+
+You can then access the props in JavaScript:
+
+```tsx
+const {hello} = getInputProps() // "world"
+```
+
+In this example, the props also get passed to the component of the composition with the id `my-composition`.
+
+## See also
+
+- [Dynamic duration, FPS & dimensions](dynamic-metadata)
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 45c99ff2e6..6d3b61401b 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -38,6 +38,7 @@ module.exports = {
"continue-render",
"delay-render",
"interpolate",
+ "get-input-props",
"random",
"register-root",
"spring",