Skip to content

🎥 Make videos programmatically with React

empty state

Jonny Burger3f68bae2dd6a
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx
index 9e5e2bc85d..2c22b0dbbe 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx
@@ -33,6 +33,7 @@ import {SchemaEditor} from './SchemaEditor/SchemaEditor';
import {
NoDefaultProps,
NoSchemaDefined,
+ ZodNotInstalled,
} from './SchemaEditor/SchemaErrorMessages';
import {WarningIndicatorButton} from './WarningIndicatorButton';
@@ -302,8 +303,7 @@ export const RenderModalData: React.FC<{
}
if (schema === 'no-zod') {
- // TODO: Make nicer modal for Zod
- return <div>Install zod</div>;
+ return <ZodNotInstalled />;
}
if (!z) {
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx
index 3590568dc0..b9dc105994 100644
--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx
+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx
@@ -40,6 +40,19 @@ const openDocs = () => {
);
};
+export const ZodNotInstalled = () => {
+ return (
+ <div style={explainer}>
+ <div style={errorExplanation}>
+ Install <code style={codeSnippet}>zod</code> as a dependency to
+ interactively control the props of the composition.
+ </div>
+ <Spacing y={2} block />
+ <Button onClick={openDocs}>Learn how</Button>
+ </div>
+ );
+};
+
export const NoSchemaDefined = () => {
return (
<div style={explainer}>
diff --git a/packages/docs/docs/parametrized-rendering.md b/packages/docs/docs/parametrized-rendering.md
index 9423c30255..b282bd20c8 100644
--- a/packages/docs/docs/parametrized-rendering.md
+++ b/packages/docs/docs/parametrized-rendering.md
@@ -74,7 +74,45 @@ Default props are useful so you don't preview your video with no data. Default p
## Define a schema <AvailableFrom v="4.0.0"/>
-You can use [`z`](https://github.com/colinhacks/zod) to define a typesafe schema for your composition.
+You can use [Zod](https://github.com/colinhacks/zod) to define a typesafe schema for your composition.
+
+Install Zod using:
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+<Tabs
+defaultValue="npm"
+values={[
+{ label: 'npm', value: 'npm', },
+{ label: 'yarn', value: 'yarn', },
+{ label: 'pnpm', value: 'pnpm', },
+]
+}>
+<TabItem value="npm">
+
+```bash
+npm i zod @remotion/zod-types
+```
+
+ </TabItem>
+
+ <TabItem value="yarn">
+
+```bash
+yarn add zod @remotion/zod-types
+```
+
+ </TabItem>
+
+ <TabItem value="pnpm">
+
+```bash
+pnpm i zod @remotion/zod-types
+```
+
+ </TabItem>
+</Tabs>
```tsx twoslash title="MyComp.tsx"
import { z } from "zod";