Capítulo 52 de 988
If a <Composition> has defaultProps but no schema, the Remotion Studio infers controls from the values in defaultProps.
type Props = {
title: string;
color: string;
showLogo: boolean;
};
const MyComponent: React.FC<Props> = () => null;
export const RemotionRoot: React.FC = () => {
return (
<Composition
id="my-video"
component={MyComponent}
durationInFrames={150}
fps={30}
width={1920}
height={1080}
defaultProps={{
title: 'Hello',
color: '#0b84ff',
showLogo: true,
}}
/>
);
};
Value in defaultProps | Inferred control |
|---|---|
| String | Text input |
| CSS color | Color picker |
Value returned by staticFile() | Asset picker |
| Number | Number input |
| Boolean | Checkbox |
Date | Date and time input |
| Plain object | Nested controls |
| Non-empty array | Array editor, if every item matches the type inferred from the first item |