Skip to content

πŸŽ₯ Make videos programmatically with React

Studio section in docs

Jonny Burgerf4111f5f4249
diff --git a/packages/docs/docs/preview.mdx b/packages/docs/docs/preview.mdx
new file mode 100644
index 0000000000..8a50b7802d
--- /dev/null
+++ b/packages/docs/docs/preview.mdx
@@ -0,0 +1,47 @@
+---
+image: /generated/articles-docs-studio.png
+title: Preview your video
+id: preview
+crumb: "Timeline basics"
+---
+
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+
+You can preview your video by starting the [Remotion Studio](/docs/studio):
+
+<Tabs
+defaultValue="Regular templates"
+values={[
+{ label: 'Regular templates', value: 'Regular templates', },
+{ label: 'Next.js and Remix templates', value: 'Next.js and Remix templates', },
+]
+}>
+<TabItem value="Regular templates">
+
+```bash
+npm start
+```
+
+ </TabItem>
+
+ <TabItem value="Next.js and Remix templates">
+
+```bash
+npm run remotion
+```
+
+ </TabItem>
+</Tabs>
+
+This is a shorthand for the [`studio`](/docs/cli/studio) command of the [Remotion CLI](/docs/cli):
+
+```bash
+npx remotion studio
+```
+
+A server will be started on port `3000` (or a higher port if it isn't available) and the Remotion Studio should open in the browser.
+
+<img src="/img/timeline.png"></img>
+
+Learn more about the [Remotion Studio](/docs/studio).
diff --git a/packages/docs/docs/studio.mdx b/packages/docs/docs/studio.mdx
deleted file mode 100644
index 8889b8ba55..0000000000
--- a/packages/docs/docs/studio.mdx
+++ /dev/null
@@ -1,150 +0,0 @@
----
-image: /generated/articles-docs-studio.png
-sidebar_label: Preview your video
-title: Remotion Studio
-id: studio
-crumb: "Timeline basics"
----
-
-import Tabs from "@theme/Tabs";
-import TabItem from "@theme/TabItem";
-
-You can preview your video by starting the Remotion Studio:
-
-<Tabs
-defaultValue="Regular templates"
-values={[
-{ label: 'Regular templates', value: 'Regular templates', },
-{ label: 'Next.js and Remix templates', value: 'Next.js and Remix templates', },
-]
-}>
-<TabItem value="Regular templates">
-
-```bash
-npm start
-```
-
- </TabItem>
-
- <TabItem value="Next.js and Remix templates">
-
-```bash
-npm run remotion
-```
-
- </TabItem>
-</Tabs>
-
-This is a shorthand for the [`studio`](/docs/cli/studio) command of the [Remotion CLI](/docs/cli):
-
-```bash
-npx remotion studio
-```
-
-A server will be started on port `3000` (or a higher port if it isn't available) and the Remotion Studio should open in the browser.
-
-<img src="/img/timeline.png"></img>
-
-## Playback controls
-
-Use the <svg
-aria-hidden="true"
-focusable="false"
-data-prefix="fas"
-data-icon="play"
-className="svg-inline--fa fa-play fa-w-14"
-role="img"
-xmlns="http://www.w3.org/2000/svg"
-viewBox="0 0 448 512" style={{height: 16, width: 16}}><path
- fill="currentColor"
- d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"
- /></svg> button or <kbd>Space</kbd> to play your video.
-
-Use the <svg viewBox="0 0 448 512" style={{height: 18, width: 18}}><path fill="currentColor" d="M64 468V44c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12v176.4l195.5-181C352.1 22.3 384 36.6 384 64v384c0 27.4-31.9 41.7-52.5 24.6L136 292.7V468c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12z" /></svg>
-and <svg viewBox="0 0 448 512" style={{height: 18, width: 18}}><path fill="currentColor" d="M384 44v424c0 6.6-5.4 12-12 12h-48c-6.6 0-12-5.4-12-12V291.6l-195.5 181C95.9 489.7 64 475.4 64 448V64c0-27.4 31.9-41.7 52.5-24.6L312 219.3V44c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12z" /></svg> buttons to jump 1 frame backwards or forwards.
-You can also use the arrow keys <kbd>β—€οΈŽ</kbd> and <kbd>β–ΆοΈŽ</kbd> to do so.
-If you hold the <kbd>Shift</kbd> key, you jump 1 second at a time.
-
-<details>
-<summary>
-Advanced playback controls
-</summary>
-
-<kbd>L</kbd> will play the video forward. Pressing it repeatedly will play it faster.
-<br />
-
-<kbd>J</kbd> will play the video backwards. Pressing it repeatedly will play it faster.
-<br />
-
-<kbd>K</kbd> will pause the video and reset the speed to 1x.
-</details>
-
-## Toggling transparent background
-
-By default, the background of your video is a checkerboard pattern signifying that the pixels are transparent. You can press <svg viewBox="0 0 512 512" style={{width: 16, height: 16}}> <path d="M480 0H32A32 32 0 0 0 0 32v448a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zm-32 256H256v192H64V256h192V64h192z" fill="currentcolor"/></svg> button to disable this behavior which will render a black background.
-
-## In / Out Markers
-
-Using In and Out markers, you can play only a certain range of your video.
-
-Click <svg viewBox="0 0 256 256" fill="none" style={{width: 16, height: 16}}><path d="M158 25H99V230.5H158" stroke="currentcolor" strokeWidth="42" strokeLinecap="round" strokeLinejoin="round"/></svg> or press <kbd>I</kbd> to set an in marker.<br/>
-Click <svg viewBox="0 0 256 256" fill="none" style={{width: 16, height: 16}}><path d="M98 25H157V230.5H98" stroke="currentcolor" strokeWidth="42" strokeLinecap="round" strokeLinejoin="round"/></svg> or press <kbd>O</kbd> to set an out marker.
-
-To clear a marker, press <kbd>X</kbd>. Alternatively, you can toggle a marker by clicking on it.
-
-To move a marker, drag a marker somewhere else.
-
-## Change the canvas size
-
-By default the video scales to fit in the preview window.
-To change the canvas size:
-
-<Step>1</Step> Pinch to zoom <br />
-<Step>2</Step> Hold <kbd>Shift</kbd> and use the scroll wheel or <br />
-<Step>3</Step>
-Use the dropdown that says <code>Fit</code>
-
-## Change the playback speed
-
-By default the video will play in regular speed. You can speed up or slow down the video by clicking on the dropdown that says `1x`.
-
-You may also choose a negative value which will play the video in reverse. Note that [`<Audio/>`](/docs/audio), [`<Video/>`](/docs/video) and [`<OffthreadVideo/>`](/docs/video) tags cannot be played in reverse, this is a browser limitation.
-
-## Render a composition
-
-Click on the `Render` button or press <kbd>R</kbd> to open the Render dialog from where you can adjust settings and render your composition.
-
-If you are using In and Out Markers, the render dialog will by default only render the selected portion.
-
-## Quick Switcher
-
-Use <kbd>⌘K</kbd> / <kbd>Ctrl+K</kbd> to access the Quick Switcher to quickly change compositions.
-Start your input with `>` to switch to the command palette.
-Start your input with `?` to search the documentation.
-
-## Compositions panel
-
-Click on the `Compositions` panel to view all registered [`<Composition />`](/docs/composition)'s in your project.<br/>
-Click on a composition to preview it or click the rocket icon to render it.
-
-## Assets panel
-
-Click on the `Assets` panel to view a representation of your `public/` folder.<br/>
-Click on an asset to preview it.
-
-## Renders panel
-
-Click on the `Renders` panel to see the progress of a render you have triggered via the studio.<br/>You may cancel, retry and preview renders from here.
-
-## Props panel
-
-Click on the `Props` panel to view and edit the props of the currently selected composition. To do so you, you need to define a [Zod schema](/docs/schemas).
-
-## Keyboard shortcuts and help
-
-Press <kbd>?</kbd> to open the help dialog which shows you all available keyboard shortcuts.
-In the opened dialog, enter a search term to search our documentation.
-
-## See also
-
-- [Deploying the Remotion Studio](/docs/deploy-studio)
diff --git a/packages/docs/docs/studio/shortcuts.md b/packages/docs/docs/studio/shortcuts.md
new file mode 100644
index 0000000000..3c85d1be8f
--- /dev/null
+++ b/packages/docs/docs/studio/shortcuts.md
@@ -0,0 +1,293 @@
+---
+title: Keyboard navigation
+crumb: "Remotion Studio"
+---
+
+## Shortcuts
+
+You can always find the list of keyboard shortcuts by pressing <kbd>?</kbd> in the Studio.
+
+### Playback
+
+<table>
+<tr>
+<td>
+ <kbd>
+ <svg viewBox="0 0 448 512" style={{ width: 10, display: "inline" }}>
+ <path
+ fill="currentColor"
+ d="M48.048 304h73.798v128c0 26.51 21.49 48 48 48h108.308c26.51 0 48-21.49 48-48V304h73.789c42.638 0 64.151-51.731 33.941-81.941l-175.943-176c-18.745-18.745-49.137-18.746-67.882 0l-175.952 176C-16.042 252.208 5.325 304 48.048 304zM224 80l176 176H278.154v176H169.846V256H48L224 80z"
+ ></path>
+ </svg>
+ </kbd>
+ <div style={{ width: 2, display: "inline-block" }} />
+ <kbd>
+ <svg viewBox="0 0 448 512" style={{ width: 10, display: "inline" }}>
+ <path
+ fill="currentColor"
+ d="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"
+ ></path>
+ </svg>
+ </kbd>{" "}
+ </td>
+ <td>
+ Move 1 second back{" "}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <kbd>
+ <svg viewBox="0 0 448 512" style={{ width: 10, display: "inline" }}>
+ <path
+ fill="currentColor"
+ d="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"
+ ></path>
+ </svg>
+ </kbd>{" "}
+ </td>
+ <td>
+Move 1 frame back
+ </td>
+ </tr>
+<tr>
+<td>
+ <kbd>Space</kbd>
+</td>
+<td>
+Play / Pause</td>
+
+</tr>
+<tr>
+<td>
+ <kbd>
+ <svg viewBox="0 0 448 512" style={{ width: 10, display: "inline" }}>
+ <path
+ fill="currentColor"
+ d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"
+ ></path>
+ </svg>
+ </kbd>{" "}
+</td>
+<td>
+ Move 1 frame forward
+</td>
+</tr>
+<tr>
+<td> <kbd>
+ <svg viewBox="0 0 448 512" style={{ width: 10, display: "inline" }}>
+ <path
+ fill="currentColor"
+ d="M48.048 304h73.798v128c0 26.51 21.49 48 48 48h108.308c26.51 0 48-21.49 48-48V304h73.789c42.638 0 64.151-51.731 33.941-81.941l-175.943-176c-18.745-18.745-49.137-18.746-67.882 0l-175.952 176C-16.042 252.208 5.325 304 48.048 304zM224 80l176 176H278.154v176H169.846V256H48L224 80z"
+ ></path>
+ </svg>
+ </kbd>
+ <div style={{ width: 2, display: "inline-block" }} />
+ <kbd>
+ <svg viewBox="0 0 448 512" style={{ width: 10, display: "inline" }}>
+ <path
+ fill="currentColor"
+ d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"
+ ></path>
+ </svg>
+ </kbd>
+</td>
+<td>
+ Move 1 second forward
+
+</td>
+</tr>
+
+<tr>
+<td>
+<kbd>A</kbd>
+</td>
+<td>
+Jump to beginning
+</td>
+</tr>
+<tr>
+<td>
+<kbd>A</kbd>
+</td>
+<td>
+Jump to end
+</td>
+</tr>
+<tr>
+<td>
+<kbd>J</kbd>
+</td>
+<td>
+Play in reverse
+</td>
+</tr>
+<tr>
+<td>
+<kbd>K</kbd>
+</td>
+<td>
+Pause
+</td>
+</tr>
+<tr>
+<td>
+<kbd>L</kbd>
+</td>
+<td>
+Play (press repeatedly to increase speed)
+</td>
+</tr>
+<tr>
+<td>
+<kbd>G</kbd>
+</td>
+<td>
+Jump to frame
+</td>
+</tr>
+<tr>
+<td>
+<kbd>Enter</kbd>
+</td>
+<td>
+Pause and return to where playback started
+</td>
+</tr>
+</table>
+
+### Sidebars
+
+<table>
+<tr>
+<td>
+<kbd>⌘/Ctrl</kbd>
+<div style={{ width: 2, display: "inline-block" }} />
+<kbd>B</kbd>
+</td>
+<td>
+Toggle left sidebar
+</td>
+</tr>
+<tr>
+<td>
+<kbd>⌘/Ctrl</kbd>
+<div style={{ width: 2, display: "inline-block" }} />
+<kbd>J</kbd>
+</td>
+<td>
+Toggle right sidebar
+</td>
+</tr>
+<tr>
+<td>
+<kbd>⌘/Ctrl</kbd>
+<div style={{ width: 2, display: "inline-block" }} />
+<kbd>G</kbd>
+</td>
+<td>
+Toggle both sidebars
+</td>
+</tr>
+</table>
+
+### View
+
+<table>
+<tr>
+<td>
+<kbd>F</kbd>
+</td>
+<td>
+Enter fullscreen
+</td>
+</tr>
+<tr>
+<td>
+<kbd>Esc</kbd>
+</td>
+<td>
+Enter fullscreen
+</td>
+</tr>
+</table>
+
+### Playback range
+
+<table>
+<tr>
+<td>
+<kbd>I</kbd>
+</td>
+<td>
+Set In Point - video will only play from this point
+</td>
+</tr>
+<tr>
+<td>
+<kbd>O</kbd>
+</td>
+<td>
+Set Out Point - video will only play until this point
+</td>
+</tr>
+<tr>
+<td>
+<kbd>X</kbd>
+</td>
+<td>
+Clear both In and Out points
+</td>
+</tr>
+</table>
+
+### Zoom
+
+<table>
+<tr>
+<td>
+<kbd>+</kbd>
+</td>
+<td>
+Zoom in
+</td>
+</tr>
+<tr>
+<td>
+<kbd>-</kbd>
+</td>
+<td>
+Zoom out
+</td>
+</tr>
+<tr>
+<td>
+<kbd>0</kbd>
+</td>
+<td>
+Reset zoom
+</td>
+</tr>
+</table>
+
+### Props editor
+
+<table>
+<tr>
+<td>
+<kbd>⌘/Ctrl</kbd>
+<div style={{ width: 2, display: "inline-block" }} />
+<kbd>S</kbd>
+</td>
+<td>
+Save props back to root file
+</td>
+</tr>
+</table>
+
+## Keyboard navigation
+
+The menus are keyboard-navigation friendly. Press <kbd>Tab</kbd> to navigate between the menus and <kbd>Enter</kbd> to select an item.
+
+## Quick Switcher
+
+Press <kbd>⌘/Ctrl</kbd> + <kbd>K</kbd> to open the Quick Switcher. You can use it to quickly navigate to any file in your project.
diff --git a/packages/docs/docs/studio/studio.mdx b/packages/docs/docs/studio/studio.mdx
new file mode 100644
index 0000000000..3388361593
--- /dev/null
+++ b/packages/docs/docs/studio/studio.mdx
@@ -0,0 +1,96 @@
+---
+image: /generated/articles-docs-studio.png
+title: Starting the Studio
+crumb: "Timeline basics"
+---
+
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+
+Using the Remotion Studio, you can preview your video, and if a server is connected, even render the video.
+
+## Prerequisites
+
+The Remotion CLI is required for this guide.
+Most templates have it out of the box, but you can install it by running the following command in your terminal:
+
+<Tabs
+defaultValue="npm"
+values={[
+{ label: 'npm', value: 'npm', },
+{ label: 'pnpm', value: 'pnpm', },
+{ label: 'yarn', value: 'yarn', },
+{ label: 'bun', value: 'bun', },
+]
+}>
+<TabItem value="npm">
+
+```bash
+npm i @remotion/cli
+```
+
+ </TabItem>
+
+ <TabItem value="pnpm">
+
+```bash
+pnpm i @remotion/cli
+```
+
+ </TabItem>
+
+ <TabItem value="yarn">
+
+```bash
+yarn add @remotion/cli
+```
+
+ </TabItem>
+ <TabItem value="yarn">
+
+```bash
+bun i @remotion/cli
+```
+
+ </TabItem>
+</Tabs>
+
+## Launching the Studio
+
+You can start the Remotion Studio by running the following command in your terminal:
+
+<Tabs
+defaultValue="Regular templates"
+values={[
+{ label: 'Regular templates', value: 'Regular templates', },
+{ label: 'Next.js and Remix templates', value: 'Next.js and Remix templates', },
+]
+}>
+<TabItem value="Regular templates">
+
+```bash
+npm start
+```
+
+ </TabItem>
+
+ <TabItem value="Next.js and Remix templates">
+
+```bash
+npm run remotion
+```
+
+ </TabItem>
+</Tabs>
+
+This is a shorthand for the [`studio`](/docs/cli/studio) command of the [Remotion CLI](/docs/cli):
+
+```bash
+npx remotion studio
+```
+
+See the available [options here](/docs/cli/studio).
+
+A server will be started on port `3000` (or a higher port if it isn't available) and the Remotion Studio should open in the browser.
+
+<img src="/img/timeline.png"></img>
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 6bb784ab66..f18820365d 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -491,7 +491,7 @@ module.exports = {
"the-fundamentals",
"animating-properties",
"reusability",
- "studio",
+ "preview",
"render",
],
},
@@ -527,7 +527,11 @@ module.exports = {
"props-resolution",
],
},
-
+ {
+ type: "category",
+ label: "Studio",
+ items: ["studio/studio", "studio/shortcuts"],
+ },
{
type: "category",
label: "Rendering",
diff --git a/packages/studio/src/components/KeyboardShortcutsExplainer.tsx b/packages/studio/src/components/KeyboardShortcutsExplainer.tsx
index 559f3f93d9..36c54f5c67 100644
--- a/packages/studio/src/components/KeyboardShortcutsExplainer.tsx
+++ b/packages/studio/src/components/KeyboardShortcutsExplainer.tsx
@@ -202,7 +202,7 @@ export const KeyboardShortcutsExplainer: React.FC = () => {
</Row>
<Row align="center">
<div style={left}>
- <kbd style={key}>esc</kbd>
+ <kbd style={key}>Esc</kbd>
</div>
<div style={right}>Exit fullscreen</div>
</Row>