🎥 Make videos programmatically with React
Skills: Refine Track guidance and use children for text
JonnyBurger2cb9cc539fd4
diff --git a/.agents/skills/remotion-new-markup/SKILL.md b/.agents/skills/remotion-new-markup/SKILL.mdindex e199f14eb1..761e918d2e 100644--- a/.agents/skills/remotion-new-markup/SKILL.md+++ b/.agents/skills/remotion-new-markup/SKILL.md@@ -7,7 +7,7 @@ description: Write or refactor Remotion markup with Track, connected compositionFollow the complete [Track + connected compositions example](../../../packages/skills/skills/remotion-interactivity/timeline-structure.md).-- Put successive scenes in a named `Track`, with `from` and `durationInFrames` directly on each instance.+- Put successive scenes in a named `<Track>`, with `from` and `durationInFrames` directly on each instance. Items in a `<Track>` MUST not overlap.- Create scenes with `Interactive.create({layout: 'absolute-fill'})`; return a fragment inside and put instance styles on the exported component.- Create bounded elements with `Interactive.create({layout: 'none'})`; forward `style` to a plain root.- Register the same exported scene and reusable element components as connected compositions, with inline metadata and representative `defaultProps`.diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.mdindex b8b5d56314..a791a429ba 100644--- a/packages/skills/skills/remotion-interactivity/SKILL.md+++ b/packages/skills/skills/remotion-interactivity/SKILL.md@@ -15,10 +15,9 @@ If the markup is too complex for the Studio to make it interactive, then the val## Prefer interactive components with their own timelines-Build new compositions with `Track`, connected compositions, and-`Interactive.create()`. Set `layout` explicitly to `'absolute-fill'` for scenes-or `'none'` for bounded elements. Register the same exported scene and reusable-element components with `Composition`.+Build new compositions with `Track`, connected compositions, and `Interactive.create()`.++Set `layout` explicitly to `'absolute-fill'` for scenes or `'none'` for bounded elements. Register the same exported scene and reusable element components with `Composition`.Start with the complete [Track + connected compositions example](timeline-structure.md).It includes the element, scene, parent timeline, and root registrations.@@ -32,8 +31,17 @@ export const MyVideo = () => {return (<Track name="Chapters">- <Chapter name="Opening" durationInFrames={3 * fps} title="Introduction" />- <Chapter name="Feature" from={3 * fps} durationInFrames={4 * fps} title="New features" />+ <Chapter+ name="Opening"+ durationInFrames={3 * fps}+ title="Introduction"+ />+ <Chapter+ name="Feature"+ from={3 * fps}+ durationInFrames={4 * fps}+ title="New features"+ /></Track>);};@@ -153,16 +161,12 @@ props. Built-in interactive components and custom components made with/>```-When removing a redundant sequence, move its timing and name to the child.-Preserve any existing child timing; do not overwrite or double-apply offsets.-A `useCurrentFrame()` call inside the component reads its local frame, while a-style expression at the call site still uses the caller's frame. Preserve that-distinction when moving animation styles.-For shared scene timing, group the content in a component made with`Interactive.create()` and time that instance. Managed roots also accept-`width` and `height` for `useVideoConfig()`. Use `Track` for successive scenes;-keep `<TransitionSeries.Sequence>` when using `TransitionSeries` for transitions.+`width` and `height` for `useVideoConfig()`.++Use `<Track>` to put items on the same Studio timeline row.+Use `<TransitionSeries>` when scenes are sequential.## Give every independently editable item its own JSX nodediff --git a/packages/skills/skills/remotion-interactivity/timeline-structure.md b/packages/skills/skills/remotion-interactivity/timeline-structure.mdindex 2c45d766e3..d7cf02ed14 100644--- a/packages/skills/skills/remotion-interactivity/timeline-structure.md+++ b/packages/skills/skills/remotion-interactivity/timeline-structure.md@@ -4,7 +4,7 @@ Use this structure for new compositions: a named `Track`, directly timed sceneinstances, and connected compositions made with `Interactive.create()`. Set`layout` explicitly: `'absolute-fill'` for scenes, `'none'` for bounded elements.-## 1. A bounded element: `layout: 'none'`+## Make components interactive with `Interactive.create()`Forward `style` to a plain root. The custom component already owns its timeline row.@@ -13,24 +13,24 @@ import type React from 'react';import {Interactive} from 'remotion';const TitleInner = ({- text,+ children,style,}: {- readonly text: string;+ readonly children: React.ReactNode;readonly style?: React.CSSProperties;-}) => <h1 style={{margin: 0, ...style}}>{text}</h1>;+}) => <h1 style={{margin: 0, ...style}}>{children}</h1>;export const Title = Interactive.create({Component: TitleInner,layout: 'none',schema: {...Interactive.textSchema,- text: {type: 'string', default: '', description: 'Text'},+ ...Interactive.childrenSchema,},});```-## 2. A scene: `layout: 'absolute-fill'`+## 2. Make scenes interactive: `layout: 'absolute-fill'`Return a fragment. Put the background and alignment on the scene instance.The managed root handles `style`, `width`, and `height`; do not forward them inside.@@ -43,14 +43,15 @@ const ChapterInner = ({title}: {readonly title: string}) => (<><Titlename="Chapter title"- text={title}style={{color: 'white',fontFamily: 'Arial, sans-serif',fontSize: 96,fontWeight: 700,}}- />+ >+ {title}+ </Title></>);@@ -64,9 +65,11 @@ export const Chapter = Interactive.create({});```-## 3. The parent: `Track` + direct timing+## 3. Parent: Group items on a `Track`++- Use a `<Track>` to put items on the same timeline row.+- If items are strictly sequential, use a [`TransitionSeries`](../remotion-markup/transitions.md) instead.-Write each instance separately, with inline names, timing, props, and styles.Do not add `Sequence` or `AbsoluteFill` wrappers.```tsx title="MyVideo.tsx"@@ -152,7 +155,7 @@ export const RemotionRoot = () => (fps={30}durationInFrames={90}defaultProps={{- text: 'Introduction',+ children: 'Introduction',style: {color: 'white',fontFamily: 'Arial, sans-serif',@@ -165,13 +168,3 @@ export const RemotionRoot = () => (</>);```--Double-click a chapter in the parent timeline to edit its connected composition.--For overlapping scene transitions, replace `Track` with-[`TransitionSeries`](../remotion-markup/transitions.md) and keep its specialized-sequence boundaries. Use plain HTML for layout-only masks and panels.--When refactoring, preserve timing and premounting. Match clipping, flex direction,-positioning, and paint order; managed roots clip by default. Compare representative-frames and open each connected composition on its own.