Skip to content

🎥 Make videos programmatically with React

Skills: Make connected compositions independent of parent styles

Jonny Burger3cd10f17232a
diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.md
index 499040b16d..ef33e0912a 100644
--- a/packages/skills/skills/remotion-interactivity/SKILL.md
+++ b/packages/skills/skills/remotion-interactivity/SKILL.md
@@ -141,6 +141,13 @@ animation as standalone compositions. Studio calls these **connected
compositions**: they can be opened in their own timeline while sharing the same
component implementation with the parent video.
+The component must work independently: define required styles such as
+`fontFamily` inside it and load its fonts without relying on the parent mounting.
+Do not depend on inherited parent styles, parent-only context providers, or
+parent mount side effects. Pass configurable values as explicit props with
+matching registration defaults. See
+[parent independence](../remotion-markup/connected-compositions.md#make-the-component-independent-of-its-parent).
+
Register the same exported component reference that the parent renders. For the
example above, use `component={LowerThird}`, not `LowerThirdInner` or an inline wrapper.
With `wrapInSequence: true`, no extra `<Sequence>` is needed for the connection.
diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.md
index b08987cfa3..e091047ce9 100644
--- a/packages/skills/skills/remotion-markup/SKILL.md
+++ b/packages/skills/skills/remotion-markup/SKILL.md
@@ -305,6 +305,10 @@ When a scene or group of layers deserves its own editable timeline, follow [conn
For a Studio request such as `Pre-compose Ambient glow (src/BarChart.tsx:134)`, find the selected sequence markup at the given location. Make a connected composition, following [connected-compositions.md](connected-compositions.md): extract the markup into a named component, preferably make it interactive with `Interactive.withSchema({wrapInSequence: true})`, and register the same exported component reference with a unique `<Composition>` in the root. Render the interactive component directly with its timing props, or as the only child of a sequence when that wrapper has a purpose. If the selected node is already a sequence, keep its props and extract its children. The registration needs dimensions, fps, duration, and `defaultProps` equivalent to its parent use. A component extraction without a registered composition does not complete a pre-compose request.
+Preserve required inherited styles, including `fontFamily`, inside the extracted
+component. Make its font loading and other dependencies independent of the
+parent, following [parent independence](connected-compositions.md#make-the-component-independent-of-its-parent).
+
## Voiceover
See [voiceover.md](voiceover.md) for adding an AI-generated voiceover to Remotion compositions using ElevenLabs TTS.
diff --git a/packages/skills/skills/remotion-markup/connected-compositions.md b/packages/skills/skills/remotion-markup/connected-compositions.md
index 5a9fd208e8..9079e77969 100644
--- a/packages/skills/skills/remotion-markup/connected-compositions.md
+++ b/packages/skills/skills/remotion-markup/connected-compositions.md
@@ -14,6 +14,31 @@ Use connected composition when a section has its own layers or timing, will be r
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.
+## Make the component independent of its parent
+
+A connected composition must work when opened on its own. Its parent is not
+mounted in that view, so do not rely on inherited parent styles, context
+providers, or side effects that run only when the parent mounts.
+
+Set required inherited styles, such as `fontFamily`, `fontWeight`, `color`, and
+`lineHeight`, on the component's own root or text elements. For example, a
+parent's `<AbsoluteFill style={{fontFamily}}>...</AbsoluteFill>` does not supply
+the font when the child composition is opened separately.
+Load custom fonts in the component's module or a shared font module it imports;
+setting `fontFamily` alone does not load a font. See [Google fonts](google-fonts.md)
+and [local fonts](local-fonts.md).
+
+If appearance or data should vary per instance, pass it through explicit props
+and provide matching `defaultProps` on the standalone registration. When
+extracting existing markup, carry over the inherited styles and dependencies
+that it needs to preserve its appearance.
+
+Verify the connected composition by opening it directly in a fresh Studio
+preview before opening the parent. Check that its fonts and appearance match
+its intended parent use without depending on the parent having mounted first.
+
+## Example
+
```tsx
// Chapter.tsx
import type React from 'react';
@@ -40,6 +65,8 @@ const ChapterInner: React.FC<ChapterProps> = ({title, style}) => {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
+ color: 'black',
+ fontFamily: 'Helvetica, Arial, sans-serif',
...style,
}}
>