Interactive.withSchema()v4.0.530
Wraps a React component so Remotion Studio shows it as interactive.
Circle.tsximport typeReact from 'react'; import {Interactive , typeInteractivitySchema } from 'remotion'; typeCircleProps = { readonlyradius ?: number; readonlycolor ?: string; readonlystyle ?:React .CSSProperties ; }; constcircleSchema = {radius : {type : 'number',min : 1,step : 1,default : 80,description : 'Radius',hiddenFromList : false, },color : {type : 'color',default : '#0b84ff',description : 'Color', }, } asconst satisfiesInteractivitySchema ; constCircleInner :React .FC <CircleProps > = ({radius = 80,color = '#0b84ff',style }) => { return ( <div style ={{ ...style ,width :radius * 2,height :radius * 2,borderRadius : '50%',backgroundColor :color , }} /> ); }; export constCircle =Interactive .withSchema ({Component :CircleInner ,componentName : '<Circle>',schema :circleSchema ,wrapInSequence : true, });
The exported Circle component accepts CircleProps, timing props, premount props and cropping props.
API
import {Interactive } from 'remotion';The options for Interactive.withSchema() are:
Component
The component to wrap.
It must accept a style?: React.CSSProperties prop and apply it to its visual root.
componentName
The component name used by Studio and in validation messages.
schema
An InteractivitySchema that describes which props are editable in Remotion Studio. Basic schemas like timing, premounting, cropping, and transforms are included by default and don't need to be specified
See: Make a component interactive
wrapInSequencev4.0.530
Wraps the component in a <Sequence> automatically.
Set this to true, unless you already have components from previous examples which handle wrapping in a <Sequence> manually.
If set to false, you need to manually forward all props.
Return value
Returns a React component.
Ref forwardingv4.0.530
If Component accepts a ref, the returned component preserves its ref type and forwards the ref directly to Component.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||
Rendering support depends on Component. Editing timeline controls requires an editable Remotion Studio session.