Skip to content

🎥 Make videos programmatically with React

Support premounting in automatic interactive wrappers

JonnyBurger848835b1b6b2
diff --git a/.agents/skills/interactivity-best-practices/SKILL.md b/.agents/skills/interactivity-best-practices/SKILL.md
index a886a75bc7..142d68f741 100644
--- a/.agents/skills/interactivity-best-practices/SKILL.md
+++ b/.agents/skills/interactivity-best-practices/SKILL.md
@@ -11,6 +11,8 @@ Use the canonical interactivity best-practices page instead:
To make an element or custom component interactive, use:
[packages/docs/docs/studio/make-component-interactive.mdx](../../../packages/docs/docs/studio/make-component-interactive.mdx)
-When using `Interactive.withSchema()`, prefer `wrapInSequence: true`. This adds `Interactive.baseSchema` automatically and exposes standard timeline controls such as trimming and visibility.
+When using `Interactive.withSchema()`, prefer `wrapInSequence: true`. This adds `Interactive.baseSchema` and `Interactive.premountSchema` automatically and exposes standard timeline and mounting controls. The component must accept a `style?: React.CSSProperties` prop and apply it to its visual root.
-Only include `Interactive.baseSchema` manually when the component needs to render its own `<Sequence>` for advanced behavior such as premounting, effects or custom timeline behavior.
+Both `wrapInSequence: true` and `wrapInSequence: {cropping: true}` expose `InteractivePremountProps`. 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`.
+
+Only include `Interactive.baseSchema` manually when the component needs to render its own `<Sequence>` for effects, multiple visual roots or custom timeline behavior.
diff --git a/packages/core/src/Interactive.tsx b/packages/core/src/Interactive.tsx
index 93cb415da3..7207358689 100644
--- a/packages/core/src/Interactive.tsx
+++ b/packages/core/src/Interactive.tsx
@@ -234,7 +234,10 @@ type ComponentWithoutReservedProps<
? unknown
: never);
-type AutomaticWrapperReservedKey = keyof InteractiveBaseProps | 'controls';
+type AutomaticWrapperReservedKey =
+ | keyof InteractiveBaseProps
+ | keyof InteractivePremountProps
+ | 'controls';
type CroppingWrapperReservedKey =
| AutomaticWrapperReservedKey
@@ -270,13 +273,15 @@ type EveryPropsBranchAcceptsStyle<Props> = [Props] extends [never]
? false
: true;
-type ComponentAcceptingStyle<Component extends React.ElementType> =
- ComponentWithoutReservedProps<Component, CroppingWrapperReservedKey> &
- (EveryPropsBranchAcceptsStyle<
- React.ComponentPropsWithoutRef<Component>
- > extends true
- ? unknown
- : never);
+type ComponentAcceptingStyle<
+ Component extends React.ElementType,
+ ReservedKey extends PropertyKey,
+> = ComponentWithoutReservedProps<Component, ReservedKey> &
+ (EveryPropsBranchAcceptsStyle<
+ React.ComponentPropsWithoutRef<Component>
+ > extends true
+ ? unknown
+ : never);
type WithSchema = {
<S extends InteractivitySchema, Component extends React.ElementType>(
@@ -287,7 +292,7 @@ type WithSchema = {
>,
'Component' | 'supportsEffects'
> & {
- readonly Component: ComponentWithoutReservedProps<
+ readonly Component: ComponentAcceptingStyle<
Component,
AutomaticWrapperReservedKey
>;
@@ -295,7 +300,11 @@ type WithSchema = {
readonly defaultSequenceName?: string;
readonly wrapInSequence: true;
},
- ): React.FC<React.ComponentPropsWithRef<Component> & InteractiveBaseProps>;
+ ): React.FC<
+ React.ComponentPropsWithRef<Component> &
+ InteractiveBaseProps &
+ InteractivePremountProps
+ >;
<S extends InteractivitySchema, Component extends React.ElementType>(
options: Omit<
WithInteractivitySchemaOptions<
@@ -304,7 +313,10 @@ type WithSchema = {
>,
'Component' | 'supportsEffects'
> & {
- readonly Component: ComponentAcceptingStyle<Component>;
+ readonly Component: ComponentAcceptingStyle<
+ Component,
+ CroppingWrapperReservedKey
+ >;
readonly defaultDurationInFrames?: number;
readonly defaultSequenceName?: string;
readonly wrapInSequence: {readonly cropping: true};
@@ -312,6 +324,7 @@ type WithSchema = {
): React.FC<
React.ComponentPropsWithRef<Component> &
InteractiveBaseProps &
+ InteractivePremountProps &
InteractiveCropProps
>;
<S extends InteractivitySchema, Props extends object>(
@@ -359,7 +372,8 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
type ComponentWrappedInSequenceProps = React.ComponentProps<
typeof Component
> &
- InteractiveBaseProps & {
+ InteractiveBaseProps &
+ InteractivePremountProps & {
readonly controls: SequenceControls | undefined;
};
const ComponentWrappedInSequence = forwardRef<
@@ -377,6 +391,10 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
name,
showInTimeline,
controls,
+ premountFor,
+ postmountFor,
+ styleWhilePremounted,
+ styleWhilePostmounted,
...componentProps
} = props;
const {
@@ -390,12 +408,36 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
readonly style?: React.CSSProperties;
readonly [key: string]: unknown;
};
+ const resolvedDurationInFrames =
+ durationInFrames ?? defaultDurationInFrames;
+ const {
+ effectivePremountFor,
+ effectivePostmountFor,
+ freezeFrame,
+ isPremountingOrPostmounting,
+ premountingActive,
+ postmountingActive,
+ premountingStyle,
+ } = usePremounting({
+ from: from ?? 0,
+ durationInFrames: resolveSequenceDuration({
+ durationInFrames: resolvedDurationInFrames,
+ playbackRate,
+ loop,
+ }),
+ premountFor: premountFor ?? null,
+ postmountFor: postmountFor ?? null,
+ style: style ?? null,
+ styleWhilePremounted: styleWhilePremounted ?? null,
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
+ hideWhilePremounted: 'opacity',
+ });
const croppedStyle = useCropStyle({
cropLeft: cropping ? cropLeft : undefined,
cropRight: cropping ? cropRight : undefined,
cropTop: cropping ? cropTop : undefined,
cropBottom: cropping ? cropBottom : undefined,
- style: cropping ? (style ?? null) : null,
+ style: cropping ? premountingStyle : null,
componentName,
});
const propsForComponent = cropping
@@ -403,27 +445,36 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
...componentPropsWithoutCropping,
style: croppedStyle ?? undefined,
}
- : componentProps;
+ : {
+ ...componentProps,
+ style: premountingStyle ?? undefined,
+ };
return (
- <SequenceWithoutSchema
- layout="none"
- durationInFrames={durationInFrames ?? defaultDurationInFrames}
- from={from}
- trimBefore={trimBefore}
- playbackRate={playbackRate}
- loop={loop}
- freeze={freeze}
- hidden={hidden}
- name={name ?? defaultSequenceName ?? componentName}
- showInTimeline={showInTimeline}
- controls={controls}
- >
- {React.createElement(Component, {
- ...propsForComponent,
- ref,
- } as React.ComponentProps<typeof Component>)}
- </SequenceWithoutSchema>
+ <Freeze frame={freezeFrame} active={isPremountingOrPostmounting}>
+ <SequenceWithoutSchema
+ layout="none"
+ durationInFrames={resolvedDurationInFrames}
+ from={from}
+ trimBefore={trimBefore}
+ playbackRate={playbackRate}
+ loop={loop}
+ freeze={freeze}
+ hidden={hidden}
+ name={name ?? defaultSequenceName ?? componentName}
+ showInTimeline={showInTimeline}
+ controls={controls}
+ _remotionInternalPremountDisplay={effectivePremountFor || null}
+ _remotionInternalPostmountDisplay={effectivePostmountFor || null}
+ _remotionInternalIsPremounting={premountingActive}
+ _remotionInternalIsPostmounting={postmountingActive}
+ >
+ {React.createElement(Component, {
+ ...propsForComponent,
+ ref,
+ } as React.ComponentProps<typeof Component>)}
+ </SequenceWithoutSchema>
+ </Freeze>
);
});
const Wrapped = withInteractivitySchema({
@@ -433,6 +484,7 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
schema: {
...schema,
...baseSchema,
+ ...premountSchema,
...(cropping ? cropSchema : {}),
},
supportsEffects: false,
@@ -440,7 +492,10 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
addSequenceStackTraces(Wrapped);
return Wrapped as React.FC<
- React.ComponentProps<typeof Component> & InteractiveBaseProps
+ React.ComponentProps<typeof Component> &
+ InteractiveBaseProps &
+ InteractivePremountProps &
+ InteractiveCropProps
>;
};
diff --git a/packages/docs/docs/interactive-with-schema.mdx b/packages/docs/docs/interactive-with-schema.mdx
index 371dc780d5..d0e92000a6 100644
--- a/packages/docs/docs/interactive-with-schema.mdx
+++ b/packages/docs/docs/interactive-with-schema.mdx
@@ -15,11 +15,12 @@ Use it when you build a component that should behave like [`<Sequence>`](/docs/s
```tsx twoslash title="Circle.tsx"
import type React from 'react';
-import {Interactive, type InteractiveTransformProps, type InteractivitySchema} from 'remotion';
+import {Interactive, type InteractivitySchema} from 'remotion';
-type CircleProps = InteractiveTransformProps & {
+type CircleProps = {
readonly radius?: number;
readonly color?: string;
+ readonly style?: React.CSSProperties;
};
const circleSchema = {
@@ -61,7 +62,7 @@ export const Circle = Interactive.withSchema({
});
```
-The exported `Circle` component accepts `CircleProps` and the common timing props from [`<Sequence>`](/docs/sequence). The wrapper registers the component in the timeline and preserves its source location for Studio edits.
+The exported `Circle` component accepts `CircleProps`, the common timing props and [`InteractivePremountProps`](/docs/interactive#interactivepremountprops). The wrapper registers the component in the timeline and preserves its source location for Studio edits.
## API
@@ -75,7 +76,7 @@ Call `Interactive.withSchema()` with an options object.
The component to wrap.
-With automatic wrapping, it only needs to accept its own public props. It must not declare `controls` or any of the common timing props because the wrapper owns those props. When cropping is enabled, it must also accept a `style` prop and apply it to its visual root, and it must not declare the crop props itself. Without automatic wrapping, it must accept `controls`.
+With automatic wrapping, it must accept a `style?: React.CSSProperties` prop and apply it to its visual root. The wrapper uses this prop for premounting, postmounting and cropping. It must not declare `controls`, the common timing props or premounting props because the wrapper owns those props. With `wrapInSequence: {cropping: true}`, it must not declare the crop props either. Without automatic wrapping, it must accept `controls`.
### `componentName`
@@ -99,28 +100,34 @@ When manually wrapping the component, forward it to the `<Sequence>` that regist
An [`InteractivitySchema`](/docs/interactivity-schema) that describes which props are editable in Remotion Studio.
-With automatic wrapping, [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) is added automatically. With `wrapInSequence: {cropping: true}`, [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) is added as well.
+With automatic wrapping, [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) and [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema) are added automatically. With `wrapInSequence: {cropping: true}`, [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) is added as well.
-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. Use [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) with `InteractiveCropProps` to opt the component into crop controls.
+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` and expose the common timing props on the returned component.
+Set to `true` to wrap `Component` in `<Sequence layout="none">`, add `Interactive.baseSchema` and `Interactive.premountSchema`, and expose the common timing and premounting props on the returned component.
-Default: `false`. Omit it when `Component` renders its own [`<Sequence>`](/docs/sequence), for example to configure premounting, effects, cropping that cannot be applied to the visual root, or custom timeline behavior.
+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.
+
+Both automatic wrapping forms expose [`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`.
#### `cropping`
Set `wrapInSequence` to `{cropping: true}` to additionally add `Interactive.cropSchema` and expose `cropLeft`, `cropRight`, `cropTop` and `cropBottom` on the returned component. 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 converts these props to a CSS `clipPath` and merges it into the `style` passed to `Component`. While cropping is applied, this replaces an existing inline `style.clipPath`. The generated [`<Sequence>`](/docs/sequence) keeps `layout="none"`.
+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"`.
```tsx twoslash title="Circle.tsx"
import type React from 'react';
-import {Interactive, type InteractiveTransformProps} from 'remotion';
+import {Interactive} from 'remotion';
+
+type CircleProps = {
+ readonly style?: React.CSSProperties;
+};
-const CircleInner: React.FC<InteractiveTransformProps> = ({style}) => <div style={style} />;
+const CircleInner: React.FC<CircleProps> = ({style}) => <div style={style} />;
const circleSchema = {};
// ---cut---
export const Circle = Interactive.withSchema({
@@ -141,7 +148,7 @@ Omit it when automatic wrapping is enabled. Components that support effects need
### Return value
-Returns a component with the public props of `Component`. With automatic wrapping, the common timing props from [`<Sequence>`](/docs/sequence) are also included. The cropping configuration additionally includes [`InteractiveCropProps`](/docs/interactive#interactivecropprops).
+Returns a component with the public props of `Component`. With automatic wrapping, the common timing props from [`<Sequence>`](/docs/sequence) and [`InteractivePremountProps`](/docs/interactive#interactivepremountprops) are also included. The cropping configuration additionally includes [`InteractiveCropProps`](/docs/interactive#interactivecropprops).
### Ref forwarding<AvailableFrom v="4.0.530" />
@@ -149,7 +156,7 @@ If `Component` accepts a ref, automatic wrapping preserves its ref type and forw
## 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 the cropping configuration consumes the crop props and passes their computed result through `style`.
+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.
In editable Studio sessions, it reads the current prop values, applies timeline overrides and passes the merged props to the inner component.
diff --git a/packages/docs/docs/studio/make-component-interactive.mdx b/packages/docs/docs/studio/make-component-interactive.mdx
index b3ee313886..ec00f9f35a 100644
--- a/packages/docs/docs/studio/make-component-interactive.mdx
+++ b/packages/docs/docs/studio/make-component-interactive.mdx
@@ -16,7 +16,7 @@ For guidance on how to structure markup well to keep it interactive, follow [Int
## Create the component
-Create any component. Make sure it accepts `style`.
+Create any component. Make sure it accepts `style` and applies it to its visual root. Automatic wrapping uses it for premounting, postmounting and cropping.
```tsx twoslash title="Badge.tsx"
import type React from 'react';
@@ -51,7 +51,7 @@ export const BadgeInner: React.FC<BadgeProps> = ({children, color = '#0b84ff', p
An [`InteractivitySchema`](/docs/interactivity-schema) describes which component props the Studio may edit.
-[`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) is added automatically - it includes things like `from`, `durationInFrames`, `trimBefore`, `freeze`, `playbackRate`, `name` and `showInTimeline`.
+[`Interactive.baseSchema`](/docs/interactive#interactivebaseschema) is added automatically - it includes things like `from`, `durationInFrames`, `trimBefore`, `freeze`, `playbackRate`, `name` and `showInTimeline`. [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema) is also added automatically.
Use [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema) if the component accepts a `style` prop and applies it to the rendered element.
@@ -148,9 +148,11 @@ export const Badge = Interactive.withSchema({
});
```
+The returned component accepts [`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. Pass `premountFor={0}` to opt out. See [Premounting](/docs/player/premounting) for details.
+
## Enable cropping<AvailableFrom v="4.0.530" />
-If your component accepts `style` and passes it through, you can make a component croppable using `wrapInSequence: {cropping: true}`.
+To make the component croppable, use `wrapInSequence: {cropping: true}`.
```tsx title="Badge.tsx"
export const Badge = Interactive.withSchema({
@@ -182,7 +184,7 @@ import {Badge} from './Badge';
export const MyComp = () => {
return (
<AbsoluteFill>
- <Badge from={30} durationInFrames={90} color="#ff5c7a" style={{translate: '120px 80px'}}>
+ <Badge from={30} durationInFrames={90} premountFor={30} color="#ff5c7a" style={{translate: '120px 80px'}}>
Sale
</Badge>
</AbsoluteFill>
diff --git a/packages/docs/elements/guidelines.mdx b/packages/docs/elements/guidelines.mdx
index 99e3279eb8..08362f0d9d 100644
--- a/packages/docs/elements/guidelines.mdx
+++ b/packages/docs/elements/guidelines.mdx
@@ -48,18 +48,19 @@ 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. To make it movable on the canvas, include [`Interactive.transformSchema`](/docs/interactive#interactivetransformschema) and apply the `style` prop to the visual root. The implementation does not appear as separate editable layers.
+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.
Use `defaultDurationInFrames` to preserve a component-owned default duration and `defaultSequenceName` when the friendly default timeline label should differ from `componentName`.
-If the Element accepts a `style` prop and applies it to its visual root, use `wrapInSequence: {cropping: true}` to also expose crop controls. If it needs premounting, effects, cropping elsewhere, or custom timeline behavior, omit `wrapInSequence` and use the [manual wrapping pattern](/docs/studio/make-component-interactive#manual-wrapping).
+Use `wrapInSequence: {cropping: true}` to also expose crop controls. Omit `wrapInSequence` only when the Element needs effects, coordinates multiple visual roots or implements custom timeline behavior.
When `wrapInSequence` is enabled:
-- `Interactive.withSchema()` adds [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), the timing props and a `<Sequence layout="none">` automatically.
-- The cropping configuration also adds [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) and merges the crop style into the `style` passed to the component.
+- `Interactive.withSchema()` adds [`Interactive.baseSchema`](/docs/interactive#interactivebaseschema), [`Interactive.premountSchema`](/docs/interactive#interactivepremountschema), the corresponding props and a `<Sequence layout="none">` automatically.
+- 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. The cropping configuration additionally adds [`Interactive.cropSchema`](/docs/interactive#interactivecropschema) and merges 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.
+- 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.
- 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/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.md
index 360685842f..752d1c3a9b 100644
--- a/packages/skills/skills/remotion-interactivity/SKILL.md
+++ b/packages/skills/skills/remotion-interactivity/SKILL.md
@@ -1,7 +1,7 @@
---
name: remotion-interactivity
description: Structure Remotion markup for interactivity
-version: 4.0.529
+version: 4.0.530
---
By writing Remotion markup in a specific way, the Remotion Studio is able to recognize the structure of the code and makes it interactive:
@@ -305,17 +305,19 @@ 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`, wraps the component in `<Sequence layout="none">` and exposes standard timeline controls such as trimming, looping and visibility.
+When using `Interactive.withSchema()`, set `wrapInSequence: true`. This adds `Interactive.baseSchema` and `Interactive.premountSchema`, wraps the component in `<Sequence layout="none">` and exposes standard timeline and mounting controls. The component must accept a `style?: React.CSSProperties` prop and apply it to its visual root so the wrapper can apply premounting styles.
Use `defaultDurationInFrames` when the generated Sequence needs a default duration, and `defaultSequenceName` when its friendly default timeline label should differ from `componentName`.
-To also expose crop controls, set `wrapInSequence: {cropping: true}`. This adds `Interactive.cropSchema` and crop props automatically. The component must accept a `style` prop and apply it to its visual root. The generated Sequence remains `layout="none"`; the wrapper merges the crop style into the component's `style`.
+To also expose crop controls, set `wrapInSequence: {cropping: true}`. This adds `Interactive.cropSchema` and crop props automatically. The generated Sequence remains `layout="none"`; the wrapper merges the premounting and crop styles into the component's `style`.
+
+Both automatic wrapping forms expose `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`.
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 advanced behavior such as premounting, effects, cropping that cannot be applied to the visual root 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.
+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.
-For manual premounting, also include `Interactive.premountSchema`, accept `InteractivePremountProps` and forward those props to the Sequence. For manual cropping on an absolute-fill Sequence, include `Interactive.cropSchema`, accept `InteractiveCropProps` and forward the crop props to the Sequence.
+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.
To make a custom userland component interactive, use:
[Make a component interactive](https://www.remotion.dev/docs/studio/make-component-interactive.md)