Skip to content

🎥 Make videos programmatically with React

write some documentation

Jonny Burger383d8618f4e6
diff --git a/packages/docs/components/Experimental.tsx b/packages/docs/components/Experimental.tsx
index 2b42b13392..8f73e37ac5 100644
--- a/packages/docs/components/Experimental.tsx
+++ b/packages/docs/components/Experimental.tsx
@@ -6,10 +6,11 @@ export const ExperimentalBadge: React.FC<{
return (
<div
style={{
- backgroundColor: "rgba(246, 229, 141,0.3)",
+ backgroundColor: "rgba(246, 229, 141, 0.3)",
borderRadius: 8,
padding: "12px 12px",
marginBottom: 24,
+ paddingBottom: 1,
}}
>
<div
diff --git a/packages/docs/components/InlineStep.tsx b/packages/docs/components/InlineStep.tsx
index c2b3f7cd7f..e97d589784 100644
--- a/packages/docs/components/InlineStep.tsx
+++ b/packages/docs/components/InlineStep.tsx
@@ -16,9 +16,26 @@ export const InlineStep: React.FC<{
borderRadius: 12,
fontSize: 13,
fontWeight: "bold",
+ verticalAlign: "top",
}}
>
{children}
</div>
);
};
+
+export const Step: React.FC<{
+ children: React.ReactNode;
+}> = ({ children }) => {
+ return (
+ <span
+ style={{
+ marginRight: 7,
+ display: "inline",
+ position: "relative",
+ }}
+ >
+ <InlineStep>{children}</InlineStep>{" "}
+ </span>
+ );
+};
diff --git a/packages/docs/docs/clipper.md b/packages/docs/docs/clipper.md
new file mode 100644
index 0000000000..2f09327294
--- /dev/null
+++ b/packages/docs/docs/clipper.md
@@ -0,0 +1,13 @@
+---
+id: clipper
+title: <Experimental.Clipper>
+crumb: "Experimental API"
+---
+
+<ExperimentalBadge>
+This package is currently a proof of technology.
+
+The API may change in any version. Monitor this documentation page to see breaking changes when upgrading.
+</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`).
diff --git a/packages/docs/docs/null.md b/packages/docs/docs/null.md
new file mode 100644
index 0000000000..72f1e1ebbf
--- /dev/null
+++ b/packages/docs/docs/null.md
@@ -0,0 +1,49 @@
+---
+id: "null"
+title: <Experimental.Null>
+crumb: "Experimental API"
+---
+
+<ExperimentalBadge>
+This component is currently a proof of technology.
+
+The API may change in any version. Monitor this documentation page to see breaking changes when upgrading.
+</ExperimentalBadge>
+
+This is a special component, that, when rendered, will skip rendering the frame altogether.
+You can render it when you are sure that the frame is empty and save rendering time.
+
+```tsx twoslash title="EmptyFrame.tsx"
+import { AbsoluteFill, Experimental } from "remotion";
+
+export const MyComp: React.FC = () => {
+ return (
+ <AbsoluteFill>
+ <Experimental.Null />
+ <div>This will not be rendered</div>
+ </AbsoluteFill>
+ );
+};
+```
+
+## Rules
+
+<p>
+<Step>1</Step> If this component is rendered, nothing visual in the frame will be rendered.
+</p>
+<p>
+<Step>2</Step> Even elements <strong>outside</strong> of the <code>{"<Null>"}</code> component will disappear.
+</p>
+<p>
+<Step>3</Step> Audio will still be rendered.
+</p>
+<p>
+<Step>4</Step> If the <code>imageFormat</code> is <code>jpeg</code>, a black frame will be generated, if the <code>imageFormat</code> is <code>png</code>, a transparent frame will be generated.
+</p>
+<p>
+<Step>5</Step> If this component is rendered, an <a href="/docs/clipper"><code>{"<Experimental.Clipper>"}</code></a> may not be rendered at the same time.
+</p>
+
+## See also
+
+- [`<Experimental.Clipper>`](/docs/clipper)
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index fdec09b7f8..4ba289156b 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -81,6 +81,8 @@ module.exports = {
"series",
"folder",
"easing",
+ "null",
+ "clipper",
],
},
{
diff --git a/packages/docs/src/theme/MDXComponents.js b/packages/docs/src/theme/MDXComponents.js
index 11447de1f7..7e6d680725 100644
--- a/packages/docs/src/theme/MDXComponents.js
+++ b/packages/docs/src/theme/MDXComponents.js
@@ -1,8 +1,11 @@
// Import the original mapper
import MDXComponents from "@theme-original/MDXComponents";
-import { InlineStep } from "../../components/InlineStep";
+import { ExperimentalBadge } from "../../components/Experimental";
+import { InlineStep, Step } from "../../components/InlineStep";
export default {
...MDXComponents,
InlineStep,
+ ExperimentalBadge,
+ Step,
};