Skip to content

🎥 Make videos programmatically with React

define rules

Jonny Burgerbb915f6cee23
diff --git a/packages/docs/docs/clipper.md b/packages/docs/docs/clipper.md
index 2f09327294..077ddfdda1 100644
--- a/packages/docs/docs/clipper.md
+++ b/packages/docs/docs/clipper.md
@@ -11,3 +11,38 @@ The API may change in any version. Monitor this documentation page to see breaki
</ExperimentalBadge>
This is a special component that will cause Remotion to only partially capture the frame of the video. The remaining area will stay black (if the render image format is `jpeg`) or transparent (if the render image format is `png`).
+
+## Example
+
+Only the left half of the component will be rendered:
+
+```tsx twoslash title="EmptyFrame.tsx"
+import { AbsoluteFill, Experimental, useVideoConfig } from "remotion";
+
+export const MyComp: React.FC = () => {
+ const { width, height } = useVideoConfig();
+ return (
+ <AbsoluteFill>
+ <Experimental.Clipper x={0} y={0} width={width / 2} height={height} />
+ <AbsoluteFill style={{ backgroundColor: "red" }}></AbsoluteFill>
+ </AbsoluteFill>
+ );
+};
+```
+
+## API
+
+The properties `x`, `y`, `width` and `height` define a rect in pixels that should be captured. All props are mandatory and require an integer.
+
+## Rules
+
+<p>
+<Step>1</Step> Even elements <strong>outside</strong> of the <code>{"<Clipper>"}</code> component will be clipped.
+</p>
+
+<p>
+<Step>2</Step> If the <code>imageFormat</code> is <code>jpeg</code>, the remaining frame will become black, if the <code>imageFormat</code> is <code>png</code>, the remaining frame will become transparent.
+</p>
+<p>
+<Step>3</Step> If this component is rendered, an <a href="/docs/null"><code>{"<Experimental.Null>"}</code></a> component may not be rendered at the same time.
+</p>