🎥 Make videos programmatically with React
Skills: Teach markup patterns that avoid redundant timeline rows
JonnyBurger495cef713a5c
diff --git a/.agents/skills/remotion-new-markup/SKILL.md b/.agents/skills/remotion-new-markup/SKILL.mdindex 5b51a1decf..7ca83d98f6 100644--- a/.agents/skills/remotion-new-markup/SKILL.md+++ b/.agents/skills/remotion-new-markup/SKILL.md@@ -5,6 +5,15 @@ description: Write or refactor Remotion markup using components that inherit tim# New Remotion Markup+Design timeline rows around editable content, not the DOM tree. Give each scene,+text item, media clip, or meaningful group one interactive owner. Use plain HTML+for layout-only containers and fragments for wrappers with no remaining purpose.++Read the public [Timeline structure guide](../../../packages/skills/skills/remotion-interactivity/timeline-structure.md)+for reusable text components, custom transition wrappers, and the layout checks+needed when refactoring. Keep reusable guidance there so it also ships with the+public markup and interactivity skills.+## Put timing on the content componentDiscourage direct use of `<Sequence>` in new markup. It provides timingdiff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.mdindex b992697983..d9180b5909 100644--- a/packages/skills/skills/remotion-interactivity/SKILL.md+++ b/packages/skills/skills/remotion-interactivity/SKILL.md@@ -15,10 +15,20 @@ If the markup is too complex for the Studio to make it interactive, then the val## Prefer interactive components with their own timelines+Design the timeline around meaningful editable content: scenes, text, media,+and groups that move together. Give each such item one interactive owner.+Layout-only containers should be plain HTML, and wrappers that do nothing+should be fragments. Do not make every DOM node a timeline item.+Use `Interactive.create({layout: 'absolute-fill'})` for components that fill their parent. The wrapper provides their visual root and timeline item, and clips overflow by default, so the inner component can return a fragment. Put timing, dimensions, and per-instance styles on the exported component.Keep visuals that belong together in the same component, so they move and trim together. An inner layout container can still provide alignment, clipping within a smaller area, or an animated group; a container that only fills the scene is usually unnecessary. Cards, text boxes, and SVGs with their own bounds can keep the default `layout: 'none'` and forward `style` to their visual root.+For reusable text components, layout-only groups, and migrations from nested+`Sequence` and `AbsoluteFill` wrappers, read+[Timeline structure](timeline-structure.md). It covers choosing the interactive+owner and preserving the rendered layout while simplifying the timeline.+```tsx title="Scene.tsx"import {Video} from '@remotion/media';import type React from 'react';diff --git a/packages/skills/skills/remotion-interactivity/timeline-structure.md b/packages/skills/skills/remotion-interactivity/timeline-structure.mdnew file mode 100644index 0000000000..32dd766b65--- /dev/null+++ b/packages/skills/skills/remotion-interactivity/timeline-structure.md@@ -0,0 +1,118 @@+# Timeline structure++Use timeline rows for content the user can meaningfully select, move, trim, or+style. A scene can contain separate text and media items, but its alignment+wrappers and decorative primitives do not each need a row.++## Choose one interactive owner per item++| Purpose | Preferred structure |+| ------------------------------------------------------- | -------------------------------------------------------------------------------------------- |+| Full-size scene or content group | `Interactive.create({layout: 'absolute-fill'})`, with a fragment inside |+| Reusable text, card, or SVG with its own bounds | `Interactive.create({layout: 'none'})`, forwarding `style` to a plain visual root |+| Individual text or graphic authored directly in a scene | A named `Interactive.H1`, `Interactive.P`, `Interactive.Div`, or appropriate media component |+| Alignment, mask, or clipping inside an item | Plain `div`, `span`, or SVG element |+| Wrapper with no layout, timing, or grouping purpose | Fragment or remove it |+| Successive non-overlapping scenes or clips | Named `Track` with timing directly on each child |+| Scenes joined by transitions | `TransitionSeries` with its specialized sequence boundaries |++Do not wrap a timing-aware component in `Sequence` just to schedule or name it.+Do not put an `Interactive.Div` around a media component just to position or+scale it when the media component accepts those styles directly.++Use named interactive groups for content that should move together, such as a+foreground group or a wall of repeated text. Use plain elements for repeated+primitives that are intentionally edited as part of that group, such as rings,+particles, or individual animated letters. Keep separate JSX nodes for items+that need independent editing.++## Reusable text owns its row and controls++An `Interactive.create()` text component already owns a timeline item. Its+inner root should normally be a plain `span`, `p`, or `div`, not another+interactive component representing the same text.++Expose content and typography on that owner. `Interactive.textSchema` supplies+typography controls; use `Interactive.childrenSchema` for React-node children+or an explicit string field for string-only text. Forward instance styles to+the visual root with `layout: 'none'`.++```tsx+import type React from 'react';+import {Interactive} from 'remotion';++const LabelInner = ({+ text,+ style,+}: {+ readonly text: string;+ readonly style?: React.CSSProperties;+}) => <span style={{display: 'inline-block', ...style}}>{text}</span>;++export const Label = Interactive.create({+ Component: LabelInner,+ layout: 'none',+ schema: {+ ...Interactive.textSchema,+ text: {type: 'string', default: '', description: 'Text'},+ },+});+```++At the call site, keep the name, timing, text, and editable styles inline:++```tsx+<Label+ name="Chapter title"+ from={30}+ durationInFrames={90}+ text="A new perspective"+ style={{fontSize: 80, fontWeight: 700, color: 'white'}}+/>+```++## Managed scene roots own layout++With `layout: 'absolute-fill'`, put instance `style`, `width`, and `height` on+the exported component. Do not declare or forward those props in its inner+component: the managed container owns them. Return a fragment unless an inner+container has an additional layout or grouping purpose.++Put editable scene backgrounds and alignment on the scene instance. Expose the+relevant schema fragments, such as `Interactive.backgroundSchema`. When the+scene is also a connected composition, register the same exported component+and provide equivalent inline `defaultProps` for its standalone appearance.+Registration defaults do not automatically apply to instances in the parent.++Custom transition presentations have a different owner: the transition+boundary already supplies their timing. Use plain positioned elements for+their masks and panels, and fragments for roots that only group children.+Adding interactive wrappers for those implementation details clutters the+timeline. Keep `TransitionSeries.Sequence` and its premounting behavior.++## Preserve behavior when removing wrappers++Wrapper removal changes CSS and frame contexts unless their responsibilities+are deliberately transferred:++- Move timing and names to the content owner without double-applying child+ offsets. Preserve local-frame animation semantics, dimensions, premounting,+ and transition overlap.+- Managed full-size roots clip overflow by default. Set+ `style={{overflow: 'visible'}}` where the old root allowed overflow.+- Preserve flex direction explicitly. `AbsoluteFill` uses a column, while a+ managed root does not imply that direction. This can change image sizing and+ child alignment even when both roots fill the same area.+- Preserve explicit width and height, percentage offsets, transform origins,+ and positioning contexts. In particular, a full-height container with+ `top: '50%'` is not equivalent to one stretched between that top and bottom.+- Check paint order after removing positioned wrappers. Text may need its own+ positioning to remain above absolutely positioned decoration.+- Keep inherited typography, background, and font loading available when a+ component is opened as a standalone connected composition.++Compare representative frames before and after, including scene and transition+boundaries. Inspect the Studio timeline for meaningful names and redundant+rows, and verify that text and style controls still target the intended item.+Investigate visual differences; do not dismiss them as harmless unless their+cause is understood, such as existing wall-clock-driven animation.diff --git a/packages/skills/skills/remotion-markup/SKILL.md b/packages/skills/skills/remotion-markup/SKILL.mdindex be0dbaf679..5201d7688b 100644--- a/packages/skills/skills/remotion-markup/SKILL.md+++ b/packages/skills/skills/remotion-markup/SKILL.md@@ -34,6 +34,9 @@ wrapper handles layout and instance styles. Sized elements such as lower thirdscan keep the default layout and forward `style` to their own root. Registerreusable scenes as connected compositions.Put timing directly on components that support it; avoid redundant `<Sequence>` wrappers.+Give each editable item one interactive owner; use plain HTML for layout-only+containers. When choosing wrappers or refactoring an existing composition, read+[Timeline structure](../remotion-interactivity/timeline-structure.md).The Studio edits the JSX source node that created an item. Author every composition registration, clip, scene, layer and sequence that should be editable independently as its own JSX node, with its editable props inline.Programmatic loops are suitable when the generated instances are intentionally controlled as one source template, not when users need to edit the instances@@ -195,7 +198,7 @@ const LowerThirdInner: React.FC<LowerThirdProps> = ({style,}) => {return (- <Interactive.Div+ <divstyle={{position: "absolute",left: 80,@@ -222,12 +225,13 @@ const LowerThirdInner: React.FC<LowerThirdProps> = ({}}/>{children}- </Interactive.Div>+ </div>);};const lowerThirdSchema = {...Interactive.childrenSchema,+ ...Interactive.textSchema,accentColor: {type: "color",default: "#0b84f3",diff --git a/packages/skills/skills/remotion-markup/transitions.md b/packages/skills/skills/remotion-markup/transitions.mdindex 17c52ebbfa..9743aa0e03 100644--- a/packages/skills/skills/remotion-markup/transitions.md+++ b/packages/skills/skills/remotion-markup/transitions.md@@ -18,6 +18,14 @@ full-frame canvas outline.Children are absolutely positioned.+In custom transition presentations, use a fragment when the root only groups+children. Use plain positioned HTML for masks, clipping, and moving panels+that implement the transition. Avoid `AbsoluteFill` or interactive wrappers+whose only purpose is transition layout; they add rows without useful editable+content. Keep the `TransitionSeries.Sequence` boundaries and preserve the+presentation's clipping and transforms. See+[Timeline structure](../remotion-interactivity/timeline-structure.md).+## Prerequisites```bash