Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into pr/197

Jonny Burger3791e85c42ca
diff --cc packages/cli/src/get-input-props.ts
index cb07c1fdfd,7eaaa6d20e..f6782a3141
--- a/packages/cli/src/get-input-props.ts
+++ b/packages/cli/src/get-input-props.ts
@@@ -1,6 -1,8 +1,8 @@@
+ import fs from 'fs';
+ import path from 'path';
import {parsedCli} from './parse-command-line';
-export const getUserProps = (): unknown => {
+export const getInputProps = (): object => {
if (!parsedCli.props) {
return {};
}
diff --cc packages/docs/docs/parametrized-rendering.md
index 2b3ef06418,d81250d13e..4c21cd8b45
--- a/packages/docs/docs/parametrized-rendering.md
+++ b/packages/docs/docs/parametrized-rendering.md
@@@ -49,23 -47,27 +49,31 @@@ export const Root = () =>
By using `React.FC`, you can ensure type safety and avoid errors caused by typos.
-## Passing props in the CLI
+## Input props
+
+Input props are props that are passed in externally while rendering that can replace or override the default props
+
+### Passing input props in the CLI
- When rendering (for example using the `npm run build` script defined in `package.json`), you can override some or all default props by passing a CLI flag. It must be valid JSON, pay attention to quote escaping. Using this technique, no type safety can be guaranteed.
+ When rendering (for example using the `npm run build` script defined in `package.json`), you can override some or all default props by passing a CLI flag. It must be either valid JSON or a path to a file that contains valid JSON. Using this technique, type safety cannot be guaranteed.
+
+ **Using inline JSON**
```bash
npx remotion render src/index.tsx HelloWorld helloworld.mp4 --props='{"propOne": "Hi", "propTwo": 10}'
```
+ **Using a file path:**
+
+ ```bash
+ npx remotion render src/index.tsx HelloWorld helloworld.mp4 --props=./path/to/props.json
+ ```
+
[See also: CLI flags](/docs/cli)
-## Passing props when server rendering
+### Passing input props when server rendering
-When server-rendering using `renderFrames`, you can pass props using the `userProps` option:
+When server-rendering using `renderFrames`, you can pass props using the `inputProps` option:
```tsx {8-10}
await renderFrames({