Skip to content

🎥 Make videos programmatically with React

zod types installation instructions

Jonny Burger1c7925bc4326
diff --git a/packages/docs/components/Installation.tsx b/packages/docs/components/Installation.tsx
index 1386b01081..6be048a509 100644
--- a/packages/docs/components/Installation.tsx
+++ b/packages/docs/components/Installation.tsx
@@ -47,6 +47,17 @@ export const Installation: React.FC<{
throw new Error("pkg is undefined");
}
+ const packages = pkg
+ .split(" ")
+ .map((p) => {
+ if (p.startsWith("@remotion")) {
+ return `${p}@${VERSION}`;
+ }
+
+ return p;
+ })
+ .join(" ");
+
return (
<div>
<Tabs
@@ -59,16 +70,16 @@ export const Installation: React.FC<{
]}
>
<TabItem value="npm">
- <LightAndDark text={`npm i --save-exact ${pkg}@${VERSION}`} />
+ <LightAndDark text={`npm i --save-exact ${packages}`} />
</TabItem>
<TabItem value="pnpm">
- <LightAndDark text={`pnpm i ${pkg}@${VERSION}`} />
+ <LightAndDark text={`pnpm i ${packages}`} />
</TabItem>
<TabItem value="bun">
- <LightAndDark text={`bun i ${pkg}@${VERSION}`} />
+ <LightAndDark text={`bun i ${packages}`} />
</TabItem>
<TabItem value="yarn">
- <LightAndDark text={`yarn --exact add ${pkg}@${VERSION}`} />
+ <LightAndDark text={`yarn --exact add ${packages}`} />
</TabItem>
</Tabs>
This assumes you are currently using v{VERSION} of Remotion.
diff --git a/packages/docs/docs/schemas.md b/packages/docs/docs/schemas.md
index d1eba85154..612a289e39 100644
--- a/packages/docs/docs/schemas.md
+++ b/packages/docs/docs/schemas.md
@@ -10,43 +10,9 @@ As an alternative to [using TypeScript types](/docs/parameterized-rendering) to
## Prerequisites
-If you want to use this feature, install `zod` and `@remotion/zod-types` for Remotion-specific types:
-
-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
-```
+If you want to use this feature, install `zod` and [`@remotion/zod-types`](/docs/zod-types/) for Remotion-specific types:
- </TabItem>
-</Tabs>
+<Installation pkg="@remotion/zod-types zod"/>
## Defining a schema
diff --git a/packages/docs/docs/zod-types/index.md b/packages/docs/docs/zod-types/index.md
index 6c8a4a5856..55c8ec99de 100644
--- a/packages/docs/docs/zod-types/index.md
+++ b/packages/docs/docs/zod-types/index.md
@@ -13,32 +13,7 @@ Includes utility types and Remotion-specific types for [Zod](https://github.com/
## Installation
-Install `@remotion/zod-types`
-
-<Tabs defaultValue="npm" values={[
-{ label: 'npm', value: 'npm', },
-{ label: 'yarn', value: 'yarn', },
-{ label: 'pnpm', value: 'pnpm', },
-]
-}>
-<TabItem value="npm">
-
-```bash
-npm i @remotion/zod-types
-```
-
-</TabItem>
-<TabItem value="yarn">
-```bash
-yarn add @remotion/zod-types
-```
-</TabItem>
-<TabItem value="pnpm">
-```bash
-pnpm i @remotion/zod-types
-```
-</TabItem>
-</Tabs>
+<Installation pkg="@remotion/zod-types"/>
## API