# Remotion Rule: Compositions > Remotion skill rule: Defining compositions, stills, folders, default props and dynamic metadata. Part of the official Remotion Agent Skill for programmatic video in React. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash npx skills add remotion-dev/skills ``` This rule activates automatically when working with compositions in a Remotion project. --- ## Intro Defining compositions, stills, folders, default props and dynamic metadata. Part of the [Remotion AI Skill](https://tokrepo.com/en/workflows/57997ead-c8fa-409c-916f-28bbc0adc8d9) — the official Agent Skill for programmatic video creation in React. **Best for**: Developers using Remotion for compositions **Works with**: Claude Code, OpenAI Codex, Cursor --- ## Rule Content A `` defines the component, width, height, fps and duration of a renderable video. It normally is placed in the `src/Root.tsx` file. ```tsx import { Composition } from "remotion"; import { MyComposition } from "./MyComposition"; export const RemotionRoot = () => { return ( ); }; ``` ## Default Props Pass `defaultProps` to provide initial values for your component. Values must be JSON-serializable (`Date`, `Map`, `Set`, and `staticFile()` are supported). ```tsx import { Composition } from "remotion"; import { MyComposition, MyCompositionProps } from "./MyComposition"; export const RemotionRoot = () => { return ( ); }; ``` Use `type` declarations for props rather than `interface` to ensure `defaultProps` type safety. ## Folders Use `` to organize compositions in the sidebar. Folder names can only contain letters, numbers, and hyphens. ```tsx import { Composition, Folder } from "remotion"; export const RemotionRoot = () => { return ( <> ); }; ``` ## Stills Use `` for single-frame images. It does not require `durationInFrames` or `fps`. ```tsx import { Still } from "remotion"; import { Thumbnail } from "./Thumbnail"; export const RemotionRoot = () => { return ( ); }; ``` ## Calculate Metadata Use `calculateMetadata` to make dimensions, duration, or props dynamic based on data. ```tsx import { Composition, CalculateMetadataFunction } from "remotion"; import { MyComposition, MyCompositionProps } from "./MyComposition"; const calculateMetadata: CalculateMetadataFunction< MyCompositionProps > = async ({ props, abortSignal }) => { const data = await fetch(`https://api.example.com/video/${props.videoId}`, { signal: abortSignal, }).then((res) => res.json()); return { durationInFrames: Math.ceil(data.duration * 30), props: { ...props, videoUrl: data.url, }, }; }; export const RemotionRoot = () => { return ( ); }; ``` The function can return `props`, `durationInFrames`, `width`, `height`, `fps`, and codec-related defaults. It runs once before rendering begins. ## Nesting compositions within another To add a composition within another composition, you can use the `` component with a `width` and `height` prop to specify the size of the composition. ```tsx ``` --- ## Source & Thanks > Created by [Remotion](https://github.com/remotion-dev). Licensed under MIT. > [remotion-dev/skills](https://github.com/remotion-dev/skills) — Rule: `compositions` Part of the [Remotion AI Skill](https://tokrepo.com/en/workflows/57997ead-c8fa-409c-916f-28bbc0adc8d9) collection on TokRepo. --- Source: https://tokrepo.com/en/workflows/60f3daaa-297d-45d9-888a-858f19998212 Author: Skill Factory