Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/transitions`: Show `TransitionSeries.Overlay` in JSX order in Studio

Jonny Burgerd6438e46a07e
diff --git a/packages/docs/docs/transitions/transitionseries.mdx b/packages/docs/docs/transitions/transitionseries.mdx
index 6664cc83b3..a39964e565 100644
--- a/packages/docs/docs/transitions/transitionseries.mdx
+++ b/packages/docs/docs/transitions/transitionseries.mdx
@@ -121,10 +121,11 @@ The overlay does [not shorten](#duration-of-a-transitionseries) the timeline β€”
The overlay is centered on the cut point by default: half the duration before the cut, half after.
Children animate independently β€” no progress context is provided.
-Takes two props:
+Relevant props:
- `durationInFrames`: How long the overlay is visible. Must be a positive integer.
- `offset?`: Shifts the overlay relative to the center of the cut point. Positive values shift right (later), negative values shift left (earlier). Default: `0`. Must be a finite integer.
+- `hidden?`: Hides the overlay without changing the duration of the series. Default: `false`. You can also toggle this in the Studio timeline.
The overlay must not extend before frame 0 or beyond the duration of the adjacent sequences.
diff --git a/packages/transitions/src/TransitionSeries.tsx b/packages/transitions/src/TransitionSeries.tsx
index 82e47b6cbe..cb70ca12ac 100644
--- a/packages/transitions/src/TransitionSeries.tsx
+++ b/packages/transitions/src/TransitionSeries.tsx
@@ -102,6 +102,7 @@ const SeriesOverlayInner: FC<InternalTransitionSeriesOverlayProps> = ({
};
const transitionSeriesOverlaySchema = {
+ hidden: Internals.sequenceSchema.hidden,
...Internals.premountSchema,
} satisfies InteractivitySchema;
@@ -318,6 +319,7 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
readonly children: React.ReactNode;
readonly index: number;
readonly controls: SequenceControls | null | undefined;
+ readonly hidden: boolean | undefined;
readonly premountFor: number | undefined;
readonly postmountFor: number | undefined;
readonly styleWhilePremounted: React.CSSProperties | undefined;
@@ -331,6 +333,7 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
name="<TS.Overlay>"
_remotionInternalDocumentationLink="https://www.remotion.dev/docs/transitions/transitionseries"
controls={info.controls ?? undefined}
+ hidden={info.hidden}
layout="absolute-fill"
premountFor={info.premountFor}
postmountFor={info.postmountFor}
@@ -496,6 +499,7 @@ const TransitionSeriesChildren: FC<{readonly children: React.ReactNode}> = ({
children: overlayProps.children,
index: i,
controls: overlayProps.controls,
+ hidden: overlayProps.hidden,
premountFor: overlayProps.premountFor,
postmountFor: overlayProps.postmountFor,
styleWhilePremounted: overlayProps.styleWhilePremounted,
diff --git a/packages/transitions/src/types.ts b/packages/transitions/src/types.ts
index a7f49a6a43..1a9a23aaea 100644
--- a/packages/transitions/src/types.ts
+++ b/packages/transitions/src/types.ts
@@ -1,6 +1,6 @@
import type React from 'react';
import type {ComponentType} from 'react';
-import type {AbsoluteFillLayout} from 'remotion';
+import type {AbsoluteFillLayout, SequencePropsWithoutDuration} from 'remotion';
import type {DrawFunction} from './TransitionSeries';
export type PresentationDirection = 'entering' | 'exiting';
@@ -47,8 +47,9 @@ export type TransitionSeriesOverlayProps = Pick<
| 'postmountFor'
| 'styleWhilePremounted'
| 'styleWhilePostmounted'
-> & {
- readonly durationInFrames: number;
- readonly offset?: number;
- readonly children: React.ReactNode;
-};
+> &
+ Pick<SequencePropsWithoutDuration, 'hidden'> & {
+ readonly durationInFrames: number;
+ readonly offset?: number;
+ readonly children: React.ReactNode;
+ };