Skip to content

🎥 Make videos programmatically with React

Skills: Add connected composition markup guidance

JonnyBurger00219b144521
diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.md
index 0bb391752d..831500d11e 100644
--- a/packages/skills/skills/remotion-markup/SKILL.md
+++ b/packages/skills/skills/remotion-markup/SKILL.md
@@ -222,6 +222,10 @@ See [text-highlights.md](text-highlights.md) for text highlights (highlight mark
See [multi-scene-video.md](multi-scene-video.md) if planning to make a video with multiple subsequent scenes.
+## Connected compositions
+
+When a scene or group of layers deserves its own editable timeline, follow [connected-compositions.md](connected-compositions.md). Prefer this structure for substantial scenes in a multi-scene video.
+
## Voiceover
See [voiceover.md](voiceover.md) for adding an AI-generated voiceover to Remotion compositions using ElevenLabs TTS.
@@ -327,7 +331,7 @@ See [calculate-metadata.md](calculate-metadata.md) for dynamically set compositi
## Advanced compositions
-See [compositions.md](compositions.md) for how to define stills, folders, default props and for how to nest compositions.
+See [compositions.md](compositions.md) for how to define stills, folders, default props and for how to nest compositions. For Studio navigation into a scene's own timeline, use [connected compositions](connected-compositions.md).
## Advanced sequencing
diff --git a/packages/skills/skills/remotion-markup/compositions.md b/packages/skills/skills/remotion-markup/compositions.md
index 0d1a4baaf6..e3a090c32b 100644
--- a/packages/skills/skills/remotion-markup/compositions.md
+++ b/packages/skills/skills/remotion-markup/compositions.md
@@ -106,7 +106,8 @@ Use [`calculateMetadata`](./calculate-metadata.md) to make dimensions, duration,
## Nesting compositions within another
-To add a composition within another composition, you can use the `<Sequence>` component with a `width` and `height` prop to specify the size of the composition.
+To render a composition's component inside another composition, use `<Sequence>` with `width` and `height` when the nested content needs its own dimensions.
+When the nested scene should have its own editable Studio timeline, use the [connected composition structure](connected-compositions.md): the sequence directly renders the same component that is registered as a `<Composition>` in the root.
```tsx
<AbsoluteFill>
diff --git a/packages/skills/skills/remotion-markup/connected-compositions.md b/packages/skills/skills/remotion-markup/connected-compositions.md
new file mode 100644
index 0000000000..644edd83b4
--- /dev/null
+++ b/packages/skills/skills/remotion-markup/connected-compositions.md
@@ -0,0 +1,62 @@
+---
+name: connected-compositions
+description: Structure scenes as connected compositions for editing in Remotion Studio
+metadata:
+ tags: composition, scene, sequence, studio, precompose
+---
+
+# Connected compositions
+
+A connected composition gives a scene or group of layers its own Studio timeline, like a precomposition in After Effects. The parent renders the scene component directly; the separate `<Composition>` registration makes that same component available for focused editing and navigation. It does not render an intermediate video file.
+
+## When to use this structure
+
+Prefer a connected composition when a section has its own layers or timing, will be reused, or would be easier to edit and preview on its own. This is the default structure for substantial scenes in a multi-scene video. Keep small, one-off elements in the parent timeline when a separate composition would add navigation without making editing easier.
+
+## Markup pattern
+
+1. Put the scene's markup in a named React component. Multiple internal layers and sequences can live inside it.
+2. Render exactly one direct instance of that component inside a `<Sequence>`, `<Series.Sequence>`, or `<TransitionSeries.Sequence>` in the parent. Give the sequence a descriptive `name` and explicit timing.
+3. Register the **same component reference** with `<Composition component={...}>` in the root. Give it a unique `id` and the dimensions, fps, and natural duration needed to preview the scene on its own. A `<Folder>` can keep scene compositions together.
+
+```tsx
+// MyVideo.tsx
+import {Series} from 'remotion';
+import {OpeningScene} from './OpeningScene';
+import {FeatureScene} from './FeatureScene';
+
+export const MyVideo = () => (
+ <Series>
+ <Series.Sequence name="Opening" durationInFrames={90}>
+ <OpeningScene />
+ </Series.Sequence>
+ <Series.Sequence name="Feature" durationInFrames={120}>
+ <FeatureScene />
+ </Series.Sequence>
+ </Series>
+);
+```
+
+```tsx
+// Root.tsx
+import {Composition, Folder} from 'remotion';
+import {MyVideo} from './MyVideo';
+import {OpeningScene} from './OpeningScene';
+import {FeatureScene} from './FeatureScene';
+
+export const RemotionRoot = () => (
+ <>
+ <Folder name="MyVideo-Scenes">
+ <Composition id="Opening" component={OpeningScene} width={1920} height={1080} fps={30} durationInFrames={90} />
+ <Composition id="Feature" component={FeatureScene} width={1920} height={1080} fps={30} durationInFrames={120} />
+ </Folder>
+ <Composition id="MyVideo" component={MyVideo} width={1920} height={1080} fps={30} durationInFrames={210} />
+ </>
+);
+```
+
+Use the same direct-child pattern with `<TransitionSeries.Sequence>` when the scenes have transitions. Use `<Sequence>` for an independently positioned scene or group. A connected scene can contain many elements; only its parent sequence needs a single direct child.
+
+The connection requires the direct child to be the registered component itself. A fragment, DOM wrapper, multiple children, or a different wrapper component between the sequence and that component prevents the match. If several compositions register the same component, Studio finds several connections; give a scene one composition registration when you want double-click to open it directly.
+
+Studio shows the connected composition on the parent timeline and in the sequence inspector. Double-clicking a sequence with one connected composition opens it at the corresponding frame. Editing the shared component changes both views. If the scene takes props, pass the intended values in the parent and use matching `defaultProps` on its standalone registration; registration does not automatically copy the parent's props. Keep scene and parent fps and dimensions aligned unless their difference is intentional.
diff --git a/packages/skills/skills/remotion-markup/multi-scene-video.md b/packages/skills/skills/remotion-markup/multi-scene-video.md
index bdfcb5d937..476e3eae83 100644
--- a/packages/skills/skills/remotion-markup/multi-scene-video.md
+++ b/packages/skills/skills/remotion-markup/multi-scene-video.md
@@ -1,81 +1,27 @@
-If the video being created is a multi-scene video, it should be structured in a special way.
-Create a new folder and put each scene in a separate file.
+# Multi-scene videos
-```tsx
-// SceneA.tsx
-export const SceneA: React.FC = () => {
- return // ...
-}
-```
+Put each substantial scene in its own component and file. Register those components as [connected compositions](connected-compositions.md) so each scene has an editable Studio timeline. The main video uses the same components as the sole direct children of its scene sequences.
-```tsx
-// SceneB.tsx
-export const SceneB: React.FC = () => {
- return // ...
-}
-```
-
-Install `@remotion/transitions` if not yet available:
-
-```
-npx remotion add @remotion/transitions
-```
+Use `<TransitionSeries>` when the scenes may have transitions. Install `@remotion/transitions` if it is missing. Give each sequence an inline `durationInFrames` value so Studio can edit its timing. The component inside a sequence may contain as many layers and nested sequences as the scene needs.
-// MyVideo.tsx
```tsx
+// MyVideo.tsx
import {TransitionSeries} from '@remotion/transitions';
-
-const MyVideo: React.FC = () => {
- return (
- <TransitionSeries>
- <TransitionSeries.Sequence durationInFrames={4 * fps} name="SceneA">
- <SceneA />
- </TransitionSeries.Sequence>
- <TransitionSeries.Sequence durationInFrames={4 * fps} name="SceneB">
- <SceneB />
- </TransitionSeries.Sequence>
- </TransitionSeries>
- )
-}
+import {OpeningScene} from './OpeningScene';
+import {FeatureScene} from './FeatureScene';
+
+export const MyVideo = () => (
+ <TransitionSeries>
+ <TransitionSeries.Sequence name="Opening" durationInFrames={90}>
+ <OpeningScene />
+ </TransitionSeries.Sequence>
+ <TransitionSeries.Sequence name="Feature" durationInFrames={120}>
+ <FeatureScene />
+ </TransitionSeries.Sequence>
+ </TransitionSeries>
+);
```
-It could also make sense to register each scene individually in the root file so it can be edited there.
-If a composition with the same component is registered, one can double click the sequence in the main composition and jump to that composition.
-
-```tsx
-export const Root: React.FC = () => {
- return (
- <>
- <Folder id="MyVideo-Scenes">
- <Composition
- id="Scene1"
- component={Scene1}
- durationInFrames={5 * fps}
- fps={30}
- width={1920}
- height={1080}
- />
- <Composition
- id="Scene2"
- component={Scene2}
- durationInFrames={5 * fps}
- fps={30}
- width={1920}
- height={1080}
- />
- </Folder>
- <Composition
- id="MyVideo"
- component={MyVideo}
- durationInFrames={10 * fps}
- fps={30}
- width={1920}
- height={1080}
- />
- </>
- )
-}
-```
+Register `OpeningScene`, `FeatureScene`, and `MyVideo` as `<Composition>` entries in the root, as shown in [connected compositions](connected-compositions.md). Keep each scene's standalone metadata and `defaultProps` consistent with how it is used in the main video. With no transition, this example needs a 210-frame main composition. If you add a transition, account for its overlap in the main duration; see [transitions](transitions.md).
-This allows the user to trim the start and end of the durations visually and add [transitions](./transitions.md) later.
-Prefer inlining the `durationInFrames` values, because only then they are editable. It's okay if the value is redundant.
+Use `<Series>` for consecutive scenes that do not need transitions. Use `<Sequence>` for scenes placed independently on the parent timeline.