🎥 Make videos programmatically with React
Make Interactive.withSchema wrap by default
JonnyBurgerb8978c92ad4a
diff --git a/packages/codemods/src/basic-captions-element-source.ts b/packages/codemods/src/basic-captions-element-source.tsindex d7ce1170c3..357e4ba410 100644--- a/packages/codemods/src/basic-captions-element-source.ts+++ b/packages/codemods/src/basic-captions-element-source.ts@@ -116,7 +116,6 @@ export const BasicCaptions = Interactive.withSchema({Component: BasicCaptionsContent,componentName: '<BasicCaptions>',schema: basicCaptionsSchema,- wrapInSequence: true,});`;diff --git a/packages/core/src/Interactive.tsx b/packages/core/src/Interactive.tsxindex 76a245478b..84768405f5 100644--- a/packages/core/src/Interactive.tsx+++ b/packages/core/src/Interactive.tsx@@ -9,8 +9,8 @@ import {backgroundSchema,baseSchema,borderRadiusSchema,- captionsSchema,borderSchema,+ captionsSchema,cropSchema,premountSchema,sequenceSchema,@@ -22,8 +22,8 @@ import {type InteractivitySchema,} from './interactivity-schema.js';import {resolveSequenceDuration} from './resolve-sequence-duration.js';-import {Sequence, SequenceWithoutSchema} from './Sequence.js';import type {AbsoluteFillLayout, SequenceProps} from './Sequence.js';+import {Sequence, SequenceWithoutSchema} from './Sequence.js';import {useCropStyle} from './use-crop-style.js';import {usePremounting} from './use-premounting.js';import {@@ -234,7 +234,7 @@ type ComponentWithoutReservedProps<? unknown: never);-type AutomaticWrapperReservedKey =+type WithSchemaReservedKey =| keyof InteractiveBaseProps| keyof InteractiveCropProps| keyof InteractivePremountProps@@ -291,10 +291,9 @@ type WithSchema = {> & {readonly Component: ComponentAcceptingStyle<Component,- AutomaticWrapperReservedKey+ WithSchemaReservedKey>;readonly defaultDurationInFrames?: number;- readonly wrapInSequence: true;},): React.FC<React.ComponentPropsWithRef<Component> &@@ -311,23 +310,26 @@ type WithSchema = {type WithSchemaImplementationOptions = Omit<WithInteractivitySchemaOptions<InteractivitySchema, object>,- 'Component'+ 'Component' | 'supportsEffects'> & {readonly Component: React.ComponentType<object>;readonly defaultDurationInFrames?: number;- readonly wrapInSequence?: false | true;+ readonly supportsEffects?: boolean;+ readonly wrapInSequence?: false;};const withSchema: WithSchema = (untypedOptions: unknown) => {const options = untypedOptions as WithSchemaImplementationOptions;- if (!options.wrapInSequence) {- const ManualWrapped = withInteractivitySchema(+ // `supportsEffects` was required by the previous API, where the component+ // owned its Sequence. Keep that behavior for existing callers.+ if ('supportsEffects' in options || options.wrapInSequence === false) {+ const LegacyWrapped = withInteractivitySchema(options as WithInteractivitySchemaOptions<InteractivitySchema, object>,);- addSequenceStackTraces(ManualWrapped);+ addSequenceStackTraces(LegacyWrapped);- return ManualWrapped as React.FC<- React.ComponentProps<typeof ManualWrapped>+ return LegacyWrapped as React.FC<+ React.ComponentProps<typeof LegacyWrapped>>;}diff --git a/packages/docs/docs/interactive-with-schema.mdx b/packages/docs/docs/interactive-with-schema.mdxindex 68040a8cf2..cb80624aef 100644--- a/packages/docs/docs/interactive-with-schema.mdx+++ b/packages/docs/docs/interactive-with-schema.mdx@@ -54,7 +54,6 @@ export const Circle = Interactive.withSchema({Component: CircleInner,componentName: '<Circle>',schema: circleSchema,- wrapInSequence: true,});```@@ -80,50 +79,35 @@ The component name used by Studio and in validation messages.### `defaultDurationInFrames?`<AvailableFrom v="4.0.530" />-Sets the default Sequence duration when automatic wrapping is enabled and no `durationInFrames` prop is passed.--### `controls`--The control state created by `Interactive.withSchema()`.+Sets the default [`<Sequence>`](/docs/sequence) duration when no `durationInFrames` prop is passed.### `schema`An [`InteractivitySchema`](/docs/interactivity-schema) that describes which props are editable in Remotion Studio.-With automatic wrapping, [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema) and [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) are added automatically.--When manually wrapping the component, include [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) for Sequence-like timeline props. Use [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema) if the component accepts a `style` prop and should expose transform controls. Add [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema) with [`InteractivePremountProps`](/docs/interactive#interactivepremountprops) or [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) with [`InteractiveCropProps`](/docs/interactive#interactivecropprops) when the custom wrapper implements those behaviors itself.-For reliable source updates, follow [Interactivity best practices](/docs/studio/interactivity-best-practices): Keep editable values inline, use hardcoded `interpolate()` keyframe arrays, use `translate`, `scale`, `rotate` and `opacity` directly, and avoid animated layout props or `transform` strings.--### `wrapInSequence?`<AvailableFrom v="4.0.530" />--Set to `true` to wrap `Component` in `<Sequence layout="none">`, add `Interactive.baseSchema`, `Interactive.premountSchema` and `Interactive.cropSchema`, and expose the common timing, premounting and cropping props on the returned component.+`Interactive.withSchema()` includes [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema) and [`Interactive.cropSchema`](/docs/interactive#interactivecropschema).-Default: `false`. Omit it only when `Component` renders its own [`<Sequence>`](/docs/sequence), for example to support effects, coordinate multiple visual roots or implement custom timeline behavior.+Use [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema) if the component should expose transform controls.-Automatic wrapping exposes [`InteractivePremountProps`](/docs/interactive#interactivepremountprops): `premountFor`, `postmountFor`, `styleWhilePremounted` and `styleWhilePostmounted`. In v4, `premountFor` defaults to `0`. From [v5.0](/docs/5-0-migration), it defaults to one second (`fps` frames). Pass `premountFor={0}` to opt out. `postmountFor` defaults to `0`.--It also exposes [`InteractiveCropProps`](/docs/interactive#interactivecropprops): `cropLeft`, `cropRight`, `cropTop` and `cropBottom`. Each value is a ratio from `0` to `1` of the corresponding width or height: `0` leaves the edge unchanged and `1` crops it fully.--The wrapper merges the incoming component `style`, the active premounting or postmounting style, and then the crop style before passing it to `Component`. The crop `clipPath` therefore replaces an earlier inline `style.clipPath`. The generated [`<Sequence>`](/docs/sequence) keeps `layout="none"`.+For reliable source updates, follow [Interactivity best practices](/docs/studio/interactivity-best-practices): Keep editable values inline, use hardcoded `interpolate()` keyframe arrays, use `translate`, `scale`, `rotate` and `opacity` directly, and avoid animated layout props or `transform` strings.-### `supportsEffects`+### Return value-Required when manually wrapping a component. Set to `true` if the component supports an `effects` prop. Otherwise, set it to `false`.+Returns a component with the public props of `Component`, the common [timing props](/docs/timing), [`InteractivePremountProps`](/docs/interactive#interactivepremountprops) and [`InteractiveCropProps`](/docs/interactive#interactivecropprops).-Omit it when automatic wrapping is enabled. Components that support effects need to render their own `<Sequence>`.+The premount props are `premountFor`, `postmountFor`, `styleWhilePremounted` and `styleWhilePostmounted`. In v4, `premountFor` defaults to `0`. From [v5.0](/docs/5-0-migration), it defaults to one second (`fps` frames). Pass `premountFor={0}` to opt out. `postmountFor` defaults to `0`.-### Return value+The cropping props are `cropLeft`, `cropRight`, `cropTop` and `cropBottom`. Each value is a ratio from `0` to `1` of the corresponding width or height: `0` leaves the edge unchanged and `1` crops it fully.-Returns a component with the public props of `Component`. With automatic wrapping, the common timing props from [`<Sequence>`](/docs/sequence), [`InteractivePremountProps`](/docs/interactive#interactivepremountprops) and [`InteractiveCropProps`](/docs/interactive#interactivecropprops) are also included.+The returned component merges the incoming `style`, the active premounting or postmounting style, and then the crop style before passing it to `Component`. The crop `clipPath` therefore replaces an earlier inline `style.clipPath`. It renders `Component` inside a [`<Sequence layout="none">`](/docs/sequence).### Ref forwarding<AvailableFrom v="4.0.530" />-If `Component` accepts a ref, automatic wrapping preserves its ref type and forwards the ref directly to `Component`.+If `Component` accepts a ref, the returned component preserves its ref type and forwards the ref directly to `Component`.## Behavior-During rendering, in the Player and in read-only Studio sessions, `Interactive.withSchema()` uses the original editable values. Automatic wrapping still applies timing and cropping. In the Player and Studio, it also applies premounting and postmounting styles and freezes the component at its first or last local frame while it is premounted or postmounted. Premounting and postmounting do not apply during rendering.+During rendering, in the Player and in read-only Studio sessions, `Interactive.withSchema()` uses the original editable values and applies timing and cropping. In the Player and Studio, it also applies premounting and postmounting styles and freezes the component at its first or last local frame while it is premounted or postmounted. Premounting and postmounting do not apply during rendering.In editable Studio sessions, it reads the current prop values, applies timeline overrides and passes the merged props to the inner component.@@ -131,7 +115,7 @@ In editable Studio sessions, it reads the current prop values, applies timeline<CompatibilityTable chrome firefox safari nodejs="" bun="" serverlessFunctions="" clientSideRendering serverSideRendering player studio hideServers />-Rendering support depends on the wrapped component. Editing timeline controls requires an editable Remotion Studio session.+Rendering support depends on `Component`. Editing timeline controls requires an editable Remotion Studio session.## See alsodiff --git a/packages/docs/docs/interactive.mdx b/packages/docs/docs/interactive.mdxindex 4ced9dca0c..997b998238 100644--- a/packages/docs/docs/interactive.mdx+++ b/packages/docs/docs/interactive.mdx@@ -64,7 +64,7 @@ therefore removes the stroke.## Schema helpers-`Interactive` also exposes schema fragments for custom timeline components.+`Interactive` also exposes reusable schema fragments for component controls.Use them with [`Interactive.withSchema()`](/docs/interactive-with-schema).@@ -74,21 +74,7 @@ Controls inherited from [`<Sequence>`](/docs/sequence):`durationInFrames`, `from`, `trimBefore`, `playbackRate`, `loop`, `freeze`, `hidden`, `name` and `showInTimeline`.-Use it for components that render a `<Sequence>` internally and forward these props to it.--```tsx twoslash title="schema.ts"-import {Interactive, type InteractivitySchema} from 'remotion';--export const shapeSchema = {- ...Interactive.baseSchema,- radius: {- type: 'number',- default: 80,- description: 'Radius',- hiddenFromList: false,- },-} as const satisfies InteractivitySchema;-```+[`Interactive.withSchema()`](/docs/interactive-with-schema) includes this schema and uses it for its [`<Sequence>`](/docs/sequence).### `Interactive.transformSchema`<AvailableFrom v="4.0.479" />@@ -105,7 +91,7 @@ Controls for cropping an element from each edge:[`cropLeft`](/docs/sequence#cropleft), [`cropRight`](/docs/sequence#cropright), [`cropTop`](/docs/sequence#croptop) and [`cropBottom`](/docs/sequence#cropbottom).-Spread this schema into a custom component's schema to opt it into crop controls. The component must apply the crop props to its rendered element or forward them to an absolute-fill [`<Sequence>`](/docs/sequence).+[`Interactive.withSchema()`](/docs/interactive-with-schema) includes this schema and applies the crop through the component's `style` prop.### `Interactive.textSchema`<AvailableFrom v="4.0.481" />@@ -163,7 +149,7 @@ Controls for mounting behavior:`premountFor` and `postmountFor`.-Use it for components that forward these props to a `<Sequence>`.+[`Interactive.withSchema()`](/docs/interactive-with-schema) includes this schema and uses the props for its [`<Sequence>`](/docs/sequence).### `Interactive.sequenceSchema`<AvailableFrom v="4.0.479" />diff --git a/packages/docs/docs/interactivity-schema.mdx b/packages/docs/docs/interactivity-schema.mdxindex 09eb42d6cd..b9a6798dd4 100644--- a/packages/docs/docs/interactivity-schema.mdx+++ b/packages/docs/docs/interactivity-schema.mdx@@ -19,7 +19,6 @@ This schema is not a Zod schema. Use [Zod schemas](/docs/schemas) for [`<Composiimport {Interactive, type InteractivitySchema} from 'remotion';export const titleCardSchema = {- ...Interactive.baseSchema,...Interactive.transformSchema,tint: {type: 'color',@@ -39,6 +38,8 @@ Keys may use dot notation. For example, a key named `style.opacity` reads from aTimeline props inherited from [`<Sequence>`](/docs/sequence): [`durationInFrames`](/docs/sequence#durationinframes), [`from`](/docs/sequence#from), [`trimBefore`](/docs/sequence#trimbefore), [`playbackRate`](/docs/sequence#playbackrate), [`loop`](/docs/sequence#loop), [`freeze`](/docs/sequence#freeze), [`hidden`](/docs/sequence#hidden), [`name`](/docs/sequence#name) and [`showInTimeline`](/docs/sequence#showintimeline).+[`Interactive.withSchema()`](/docs/interactive-with-schema) includes this fragment and uses it for its [`<Sequence>`](/docs/sequence).+### `Interactive.captionsSchema`<AvailableFrom v="4.0.500" />A `captions` field for components that accept [`Caption[]`](/docs/captions/caption) data. It enables the captions inspector and is not keyframable.@@ -51,9 +52,9 @@ Transform-related style props: `style.transformOrigin`, `style.translate`, `styl### `Interactive.cropSchema`<AvailableFrom v="4.0.500" />-Crop props inherited from an absolute-fill [`<Sequence>`](/docs/sequence): [`cropLeft`](/docs/sequence#cropleft), [`cropRight`](/docs/sequence#cropright), [`cropTop`](/docs/sequence#croptop) and [`cropBottom`](/docs/sequence#cropbottom).+Controls for cropping a component from each edge: [`cropLeft`](/docs/sequence#cropleft), [`cropRight`](/docs/sequence#cropright), [`cropTop`](/docs/sequence#croptop) and [`cropBottom`](/docs/sequence#cropbottom).-Use this fragment to opt a custom component into crop controls. The component must apply the crop props to its rendered element or forward them to an absolute-fill `<Sequence>`.+[`Interactive.withSchema()`](/docs/interactive-with-schema) includes this fragment and applies the crop through the component's `style` prop.### `Interactive.textSchema`<AvailableFrom v="4.0.481" />@@ -85,6 +86,8 @@ When `style.borderRadius` is a number or contains one to four pixel values, theMounting props: `premountFor` and `postmountFor`.+[`Interactive.withSchema()`](/docs/interactive-with-schema) includes this fragment and uses the props for its [`<Sequence>`](/docs/sequence).+These schemas are for component props. Effects created with [`createEffect()`](/docs/create-effect) should define only their own effect parameters.## Field Typesdiff --git a/packages/docs/docs/sequence.mdx b/packages/docs/docs/sequence.mdxindex 651a55b80c..e079466e66 100644--- a/packages/docs/docs/sequence.mdx+++ b/packages/docs/docs/sequence.mdx@@ -312,12 +312,6 @@ Gives the sequence a specific `style={{width: width}}` style and overrides `widtYou can give your sequence a name and it will be shown as the label of the sequence in the timeline of the Remotion Studio. This property is purely for helping you keep track of sequences in the timeline.-### `controls?`<AvailableFrom v="4.0.501" />--The control state created by [`Interactive.withSchema()`](/docs/interactive-with-schema).--When [making a custom component interactive](/docs/studio/make-component-interactive) with a manually rendered `<Sequence>`, forward `controls` unchanged from the inner component. Do not create this object manually. With automatic wrapping, [`Interactive.withSchema()`](/docs/interactive-with-schema) handles this automatically.-### `layout?`Either `"absolute-fill"` _(default)_ or `"none"`. By default, your sequences will be absolutely positioned, so they will overlay each other. If you would like to opt out of it and handle layouting yourself, pass `layout="none"`. Available since v1.4.@@ -435,7 +429,7 @@ const MyComp = () => {Refs require the wrapper element created by `layout="absolute-fill"`. A `<Sequence layout="none">` rejects refs because it does not render a wrapper element.-When [`Interactive.withSchema()`](/docs/interactive-with-schema) creates a layout-none Sequence automatically, a ref is forwarded to the inner component instead of the generated Sequence, if the inner component accepts one.+A ref passed to a component returned by [`Interactive.withSchema()`](/docs/interactive-with-schema) is forwarded to the original component, if it accepts one.## Note for `@remotion/three`diff --git a/packages/docs/docs/studio/make-component-interactive.mdx b/packages/docs/docs/studio/make-component-interactive.mdxindex 9a700ff1f9..a76051d3c3 100644--- a/packages/docs/docs/studio/make-component-interactive.mdx+++ b/packages/docs/docs/studio/make-component-interactive.mdx@@ -69,11 +69,11 @@ const badgeSchema = {} as const satisfies InteractivitySchema;```-[`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) is added automatically - it includes things like `from`, `durationInFrames`, `trimBefore`, `freeze`, `playbackRate`, `name` and `showInTimeline`.+`Interactive.withSchema()` includes [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), which provides props such as `from`, `durationInFrames`, `trimBefore`, `freeze`, `playbackRate`, `name` and `showInTimeline`.-[`Interactive.premountSchema`](/docs/interactive#interactivepremountschema) is also added automatically, it allows for [premounting](/docs/player/premounting) components.+It also includes [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema), allowing the component to be [premounted](/docs/player/premounting).-[`Interactive.cropSchema`](/docs/interactive#interactivecropschema) is added automatically as well, allowing the component to be cropped from any side.+It includes [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) as well, allowing the component to be cropped from any side.Include [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema) to allow 2D and 3D transformations.@@ -145,7 +145,6 @@ export const Badge = Interactive.withSchema({Component: BadgeInner,componentName: '<Badge>',schema: badgeSchema,- wrapInSequence: true,});```diff --git a/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx b/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsxindex 399e7bac00..c98714ae61 100644--- a/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx+++ b/packages/docs/elements/audio/mirrored-spectrum/mirrored-spectrum.tsx@@ -124,5 +124,4 @@ export const MirroredAudioSpectrum = Interactive.withSchema({Component: MirroredAudioSpectrumInner,componentName: '<MirroredAudioSpectrum>',schema: mirroredAudioSpectrumSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx b/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsxindex 026a20b899..66998fdf9d 100644--- a/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx+++ b/packages/docs/elements/audio/oscilloscope/audio-oscilloscope.tsx@@ -140,5 +140,4 @@ export const AudioOscilloscope = Interactive.withSchema({Component: AudioOscilloscopeInner,componentName: '<AudioOscilloscope>',schema: audioOscilloscopeSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx b/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsxindex 448f3af725..a73c4e24f7 100644--- a/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx+++ b/packages/docs/elements/audio/waveform-progress/audio-waveform-progress.tsx@@ -198,5 +198,4 @@ export const AudioWaveformProgress = Interactive.withSchema({componentName: '<AudioWaveformProgress>',defaultDurationInFrames: 271,schema: audioWaveformProgressSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/captions/basic-captions/basic-captions.tsx b/packages/docs/elements/captions/basic-captions/basic-captions.tsxindex 740f377ae9..c0174f3b27 100644--- a/packages/docs/elements/captions/basic-captions/basic-captions.tsx+++ b/packages/docs/elements/captions/basic-captions/basic-captions.tsx@@ -115,5 +115,4 @@ export const BasicCaptions = Interactive.withSchema({Component: BasicCaptionsContent,componentName: '<BasicCaptions>',schema: basicCaptionsSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx b/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsxindex feaf6724b4..73ad51e793 100644--- a/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx+++ b/packages/docs/elements/captions/moving-pill-captions/moving-pill-captions.tsx@@ -379,5 +379,4 @@ export const MovingPillCaptions = Interactive.withSchema({Component: MovingPillCaptionsContent,componentName: '<MovingPillCaptions>',schema: movingPillCaptionsSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx b/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsxindex 1eac2ac1ee..61d5d20e0f 100644--- a/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx+++ b/packages/docs/elements/captions/popping-word-captions/popping-word-captions.tsx@@ -285,5 +285,4 @@ export const PoppingWordCaptions = Interactive.withSchema({Component: PoppingWordCaptionsContent,componentName: '<PoppingWordCaptions>',schema: poppingWordCaptionsSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx b/packages/docs/elements/captions/rounded-captions/rounded-captions.tsxindex 03028e550e..c8a409412c 100644--- a/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx+++ b/packages/docs/elements/captions/rounded-captions/rounded-captions.tsx@@ -212,5 +212,4 @@ export const RoundedCaptions = Interactive.withSchema({Component: RoundedCaptionsContent,componentName: '<RoundedCaptions>',schema: roundedCaptionsSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx b/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsxindex c68e3e35e4..e3ab100889 100644--- a/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx+++ b/packages/docs/elements/captions/word-highlight-captions/word-highlight-captions.tsx@@ -243,5 +243,4 @@ export const WordHighlightCaptions = Interactive.withSchema({Component: WordHighlightCaptionsContent,componentName: '<WordHighlightCaptions>',schema: wordHighlightCaptionsSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/commerce/product-collection/product-collection.tsx b/packages/docs/elements/commerce/product-collection/product-collection.tsxindex 96b7f45c3c..d1c94e21ad 100644--- a/packages/docs/elements/commerce/product-collection/product-collection.tsx+++ b/packages/docs/elements/commerce/product-collection/product-collection.tsx@@ -174,7 +174,6 @@ const ProductCard = Interactive.withSchema({Component: ProductCardInner,componentName: '<ProductCard>',schema: productCardSchema,- wrapInSequence: true,});export const ProductCollection = () => {diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/guidelines.mdxindex 63e1775938..9911708734 100644--- a/packages/docs/elements/guidelines.mdx+++ b/packages/docs/elements/guidelines.mdx@@ -48,19 +48,17 @@ Use `installationMode: 'component-owned-sequence'` when Studio interactivity doe- Canvas-based Elements where individual outlines cannot be passed to Studio- Single-image overlays where the image itself cannot be edited-Wrap the exported component with [`Interactive.withSchema()`](/docs/interactive-with-schema) and set `wrapInSequence: true`. The user gets one timeline layer that they can trim. The component must accept a `style` prop and apply it to its visual root. To make it movable on the canvas, include [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema). The implementation does not appear as separate editable layers.+Wrap the exported component with [`Interactive.withSchema()`](/docs/interactive-with-schema). The user gets one timeline layer that they can trim. The component must accept a `style` prop and apply it to its visual root. To make it movable on the canvas, include [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema). The implementation does not appear as separate editable layers.Use `defaultDurationInFrames` to preserve a component-owned default duration.-This also exposes crop controls. Omit `wrapInSequence` only when the Element needs effects, coordinates multiple visual roots or implements custom timeline behavior.+`Interactive.withSchema()`:-When `wrapInSequence` is enabled:--- `Interactive.withSchema()` adds [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema), [`Interactive.cropSchema`](/docs/interactive#interactivecropschema), the corresponding props and a `<Sequence layout="none">` automatically.+- Adds [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema), [`Interactive.cropSchema`](/docs/interactive#interactivecropschema), the corresponding props and a `<Sequence layout="none">`.- Premounting defaults to `0` frames in v4 and one second in v5. Pass `premountFor={0}` to opt out of the v5 default.- The wrapper merges the incoming `style` with active premounting or postmounting styles and the crop style last.- Pass `style` to the rendered element. Studio discovers its outline automatically. Set the dimensions in the component because Element metadata does not pass them as props.-- Frame-dependent animation inside the component respects `from`, `trimBefore`, `durationInFrames`, `playbackRate`, `loop`, and `freeze` because the generated Sequence is outside it. Its local time is frozen at the first or last frame while premounted or postmounted.+- Frame-dependent animation inside the component respects `from`, `trimBefore`, `durationInFrames`, `playbackRate`, `loop`, and `freeze` because the wrapper's Sequence is outside it. Its local time is frozen at the first or last frame while premounted or postmounted.- If the inner component accepts a React ref, refs passed to the exported component are forwarded directly to it.Export the schema-enabled component directly, without another forwarding wrapper.diff --git a/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx b/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsxindex 6b21ea3f36..c1ec9b4e1a 100644--- a/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx+++ b/packages/docs/elements/maps/map-flyover/a-to-b-map-flyover.tsx@@ -594,5 +594,4 @@ export const MapFlyover = Interactive.withSchema({Component: MapFlyoverContent,componentName: '<MapFlyover>',schema: mapFlyoverSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx b/packages/docs/elements/maps/watercolor-map/watercolor-map.tsxindex 81b7b37df1..d736de0ac7 100644--- a/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx+++ b/packages/docs/elements/maps/watercolor-map/watercolor-map.tsx@@ -393,5 +393,4 @@ export const WatercolorMap = Interactive.withSchema({Component: WatercolorMapContent,componentName: '<WatercolorMap>',schema: watercolorMapSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx b/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsxindex 15f3610c2d..91e344de78 100644--- a/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx+++ b/packages/docs/elements/overlays/social-safe-zones/social-safe-zones.tsx@@ -83,5 +83,4 @@ export const SocialSafeZones = Interactive.withSchema({Component: SocialSafeZonesInner,componentName: '<SocialSafeZones>',schema: socialSafeZonesSchema,- wrapInSequence: true,});diff --git a/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx b/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsxindex 08a80c593d..b2df40206c 100644--- a/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx+++ b/packages/docs/elements/text/spinning-text-wheel/spinning-text-wheel.tsx@@ -142,5 +142,4 @@ export const SpinningTextWheel = Interactive.withSchema({Component: SpinningTextWheelInner,componentName: '<SpinningTextWheel>',schema: spinningTextWheelSchema,- wrapInSequence: true,});diff --git a/packages/example/src/mirrored-spectrum.element.tsx b/packages/example/src/mirrored-spectrum.element.tsxindex 8bf5208b09..5d10b97cbb 100644--- a/packages/example/src/mirrored-spectrum.element.tsx+++ b/packages/example/src/mirrored-spectrum.element.tsx@@ -124,5 +124,4 @@ export const MirroredAudioSpectrum = Interactive.withSchema({Component: MirroredAudioSpectrumContent,componentName: '<MirroredAudioSpectrum>',schema: mirroredAudioSpectrumSchema,- wrapInSequence: true,});diff --git a/packages/example/src/moving-pill-captions.element.tsx b/packages/example/src/moving-pill-captions.element.tsxindex 8f6bbb100c..e59113406d 100644--- a/packages/example/src/moving-pill-captions.element.tsx+++ b/packages/example/src/moving-pill-captions.element.tsx@@ -391,5 +391,4 @@ export const MovingPillCaptions = Interactive.withSchema({Component: MovingPillCaptionsContent,componentName: '<MovingPillCaptions>',schema: movingPillCaptionsSchema,- wrapInSequence: true,});diff --git a/packages/example/src/oscilloscope.element.tsx b/packages/example/src/oscilloscope.element.tsxindex 40455060a2..8d9993120d 100644--- a/packages/example/src/oscilloscope.element.tsx+++ b/packages/example/src/oscilloscope.element.tsx@@ -140,5 +140,4 @@ export const AudioOscilloscope = Interactive.withSchema({Component: AudioOscilloscopeContent,componentName: '<AudioOscilloscope>',schema: audioOscilloscopeSchema,- wrapInSequence: true,});diff --git a/packages/maptiler/src/MapViewport.tsx b/packages/maptiler/src/MapViewport.tsxindex 432ca65b28..183905fa46 100644--- a/packages/maptiler/src/MapViewport.tsx+++ b/packages/maptiler/src/MapViewport.tsx@@ -535,5 +535,4 @@ export const MapViewport: ComponentType<MapViewportProps> =Component: MapViewportContent,componentName: '<MapViewport>',schema: mapViewportSchema,- wrapInSequence: true,});diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.mdindex 877472b9f5..2113f3b319 100644--- a/packages/skills/skills/remotion-interactivity/SKILL.md+++ b/packages/skills/skills/remotion-interactivity/SKILL.md@@ -305,19 +305,15 @@ Render separate elements if one version should have effects and another should n## Making your own component interactive-When using `Interactive.withSchema()`, set `wrapInSequence: true`. This adds `Interactive.baseSchema`, `Interactive.premountSchema` and `Interactive.cropSchema`, wraps the component in `<Sequence layout="none">` and exposes standard timeline, mounting and cropping controls. The component must accept a `style?: React.CSSProperties` prop and apply it to its visual root so the wrapper can apply premounting and crop styles.+`Interactive.withSchema()` adds `Interactive.baseSchema`, `Interactive.premountSchema` and `Interactive.cropSchema`, wraps the component in `<Sequence layout="none">` and exposes standard timeline, mounting and cropping controls. The component must accept a `style?: React.CSSProperties` prop and apply it to its visual root so the wrapper can apply premounting and crop styles.-Use `defaultDurationInFrames` when the generated Sequence needs a default duration.+Use `defaultDurationInFrames` when the wrapped component needs a default duration.-Automatic wrapping exposes `InteractivePremountProps`: `premountFor`, `postmountFor`, `styleWhilePremounted` and `styleWhilePostmounted`. In v4, `premountFor` defaults to `0`. In v5, it defaults to one second (`fps` frames); pass `premountFor={0}` to opt out. `postmountFor` defaults to `0`.+The wrapper exposes `InteractivePremountProps`: `premountFor`, `postmountFor`, `styleWhilePremounted` and `styleWhilePostmounted`. In v4, `premountFor` defaults to `0`. In v5, it defaults to one second (`fps` frames); pass `premountFor={0}` to opt out. `postmountFor` defaults to `0`.It also exposes `InteractiveCropProps`: `cropLeft`, `cropRight`, `cropTop` and `cropBottom`. The wrapper merges the premounting and crop styles into the component's `style`.-If the wrapped component accepts a React ref, automatic wrapping forwards refs directly to it.--Omit `wrapInSequence` only when the component needs to render its own `<Sequence>` for effects, multiple visual roots or custom timeline behavior. In that case, include `Interactive.baseSchema`; forward `durationInFrames`, `from`, `trimBefore`, `playbackRate`, `loop`, `freeze`, `hidden`, `name`, `showInTimeline` and the injected `controls` prop to the `<Sequence>`; and set `supportsEffects` to `true` or `false` in the `Interactive.withSchema()` options.--If a manual wrapper also exposes premounting, include `Interactive.premountSchema`, accept `InteractivePremountProps` and implement those props in its Sequence behavior. For manual cropping on an absolute-fill Sequence, include `Interactive.cropSchema`, accept `InteractiveCropProps` and forward the crop props to the Sequence.+If the wrapped component accepts a React ref, the wrapper forwards refs directly to it.To make a custom userland component interactive, use:[Make a component interactive](https://www.remotion.dev/docs/studio/make-component-interactive.md)