Skip to content

πŸŽ₯ Make videos programmatically with React

better docs

Jonny Burger83f8f02e134f
diff --git a/packages/docs/docs/zod-types-v3/index.mdx b/packages/docs/docs/zod-types-v3/index.mdx
index a70701e7f2..1a6f6c57e6 100644
--- a/packages/docs/docs/zod-types-v3/index.mdx
+++ b/packages/docs/docs/zod-types-v3/index.mdx
@@ -9,7 +9,8 @@ import {ZodTypesTableOfContents} from '../zod-types/TableOfContents';
This package provides the same utility types as [`@remotion/zod-types`](/docs/zod-types), but based on Zod 3.22.3 instead of Zod v4.
Use this package if you are composing Remotion's Zod types with your own schemas that use Zod 3.22.3.
-If you are using Zod v4, use [`@remotion/zod-types`](/docs/zod-types) instead.
+If you are using Zod v4, use [`@remotion/zod-types`](/docs/zod-types) instead.
+Other versions of Zod v3 might not compose well – we recommend staying on Zod 3.22.3 or upgrading to Zod v4.
<AvailableFrom v="4.0.426" />
diff --git a/packages/docs/docs/zod-types/index.mdx b/packages/docs/docs/zod-types/index.mdx
index 7713c187a3..976a911ac8 100644
--- a/packages/docs/docs/zod-types/index.mdx
+++ b/packages/docs/docs/zod-types/index.mdx
@@ -10,9 +10,9 @@ import TabItem from '@theme/TabItem';
import {ZodTypesTableOfContents} from './TableOfContents';
Since Remotion v4.0.426, `@remotion/zod-types` is based on Zod v4.
-If you want to compose these types with your own Zod schemas, use Zod v4.
+If you want, you can now upgrade to Zod v4.
-If you are using Zod 3.22.3, use [`@remotion/zod-types-v3`](/docs/zod-types-v3) instead.
+If you want to stay on Zod 3.22.3 as previously required by Remotion, use [`@remotion/zod-types-v3`](/docs/zod-types-v3) instead of [`@remotion/zod-types`](/docs/zod-types).
Other versions of Zod v3 might not compose well – we recommend staying on Zod 3.22.3 or upgrading to Zod v4.
Includes utility types and Remotion-specific types for [Zod](https://github.com/colinhacks/zod).
diff --git a/packages/docs/docs/zod-types/v3.mdx b/packages/docs/docs/zod-types/v3.mdx
index 8dabcf45ca..94df07c252 100644
--- a/packages/docs/docs/zod-types/v3.mdx
+++ b/packages/docs/docs/zod-types/v3.mdx
@@ -1,11 +1,15 @@
---
image: /generated/articles-docs-zod-types-v3.png
-sidebar_label: Zod v3
+sidebar_label: Zod 3 vs. Zod 4
title: '@remotion/zod-types-v3'
crumb: Schema
---
-`@remotion/zod-types` creates schemas using Zod v4. If you are still using Zod v3 and need to compose Remotion schemas into a `z.object()`, use `@remotion/zod-types-v3` instead.
+# @remotion/zod-types-v3<AvailableFrom v="4.0.426" />
+
+[`@remotion/zod-types`](/docs/zod-types) creates schemas using Zod v4 since Remotion v4.0.426.
+
+This package is for if you are using Zod v3.22.3 and want to compose functions like [`zColor()`] with Zod v3.22.3 schemas.
## Installation
@@ -13,8 +17,8 @@ crumb: Schema
## Usage
-```tsx title="Using @remotion/zod-types-v3 with Zod v3"
-import {z} from 'zod';
+```tsx twoslash title="Using @remotion/zod-types-v3 with Zod v3"
+import {z} from 'zod'; // zod = 3.22.3
import {zColor} from '@remotion/zod-types-v3';
export const mySchema = z.object({
@@ -22,12 +26,42 @@ export const mySchema = z.object({
});
```
-The package exports the same `zColor()`, `zTextarea()`, and `zMatrix()` functions as `@remotion/zod-types`, but they return Zod v3 schema types.
+The package exports the same [`zColor()`](/docs/zod-types/z-color), [`zTextarea()`](/docs/zod-types/z-textarea), and [`zMatrix()`](/docs/zod-types/z-matrix) functions as [`@remotion/zod-types`](/docs/zod-types), but they return Zod v3.22.3 schema types.
## When to use
-- Use `@remotion/zod-types` (default) if you are using Zod v4.
-- Use `@remotion/zod-types-v3` if you are still on Zod v3.
+Use [`@remotion/zod-types`](/docs/zod-types) with Zod v4:
+
+```tsx twoslash
+import {z} from 'zod'; // zod = 4.x.x
+import {zColor} from '@remotion/zod-types';
+
+export const mySchema = z.object({
+ color: zColor(),
+});
+```
+
+Use [`@remotion/zod-types`](/docs/zod-types) if you are not nesting schemas:
+
+```tsx twoslash
+import {zColor} from '@remotion/zod-types';
+import {visualControl} from '@remotion/studio';
+
+export const myVisualControl = visualControl('my-color', '#fff', zColor());
+```
+
+Use [`@remotion/zod-types-v3`](/docs/zod-types-v3) with Zod v3.22.3:
+
+```tsx twoslash
+import {z} from 'zod'; // zod = 3.22.3
+import {zColor} from '@remotion/zod-types-v3';
+
+export const mySchema = z.object({
+ color: zColor(),
+});
+```
+
+Other Zod 3.x.x versions are not officially supported.
## See also