🎥 Make videos programmatically with React
Docs: Add examples section structure
Igor Samokhovets55c48e9bda41
diff --cc packages/docs/examples-sidebars.tsindex 9b5a58360f,0000000000..6f6736525emode 100644,000000..100644--- a/packages/docs/examples-sidebars.ts+++ b/packages/docs/examples-sidebars.ts@@@ -1,70 -1,0 +1,98 @@@+// @ts-expect-error+import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';++const sidebars: SidebarsConfig = {+ examplesSidebar: [+ 'index',++ 'suggest-an-example',++ {++ type: 'html',++ value:++ '<hr style="margin-top: 4px; margin-bottom: 4px; border-bottom: none"/>',++ defaultStyle: true,++ },+ {+ type: 'category',+ label: 'Maps',+ link: {type: 'doc', id: 'maps/index'},- items: [],++ collapsed: false,++ items: ['maps/mapbox-line-from-a-to-b', 'maps/3d-building'],+ },+ {+ type: 'category',+ label: 'Sport',+ link: {type: 'doc', id: 'sport/index'},- items: [],++ collapsed: false,++ items: ['sport/strava-visualization', 'sport/mapbox-athletes-eye-demo'],+ },+ {+ type: 'category',+ label: 'Storytelling',+ link: {type: 'doc', id: 'storytelling/index'},- items: [],++ collapsed: false,++ items: [++ 'storytelling/paper-js-highlight',++ 'storytelling/news-headline',++ 'storytelling/bar-chart',++ 'storytelling/pie-chart',++ 'storytelling/number-wheel',++ ],+ },+ {+ type: 'category',+ label: 'Audio',+ link: {type: 'doc', id: 'audio/index'},- items: [],++ collapsed: false,++ items: ['audio/music-visualizer', 'audio/audiogram'],+ },+ {+ type: 'category',+ label: 'Captions',+ link: {type: 'doc', id: 'captions/index'},- items: [],++ collapsed: false,++ items: ['captions/tiktok-style-captions', 'captions/lyrics-animation'],+ },+ {+ type: 'category',+ label: 'Motion design system',+ link: {type: 'doc', id: 'motion-design-system/index'},- items: [],++ collapsed: false,++ items: ['motion-design-system/lower-third', 'motion-design-system/code-example'],+ },+ {+ type: 'category',+ label: 'Effects',+ link: {type: 'doc', id: 'effects/index'},- items: [],++ collapsed: false,++ items: [++ 'effects/greenscreen',++ 'effects/wiggle',++ 'effects/magnifier',++ 'effects/sticker-peel',++ ],+ },+ {+ type: 'category',+ label: 'WebGL',+ link: {type: 'doc', id: 'webgl/index'},- items: [],++ collapsed: false,++ items: ['webgl/chromatic-aberration'],+ },+ {+ type: 'category',+ label: '3D',+ link: {type: 'doc', id: '3d/index'},- items: [],++ collapsed: false,++ items: ['3d/spinning-object', '3d/video-texture'],+ },+ {+ type: 'category',+ label: 'Remotion best practices',+ link: {type: 'doc', id: 'best-practices/index'},- items: [],++ collapsed: false,++ items: ['best-practices/drag-and-drop', 'best-practices/jumpcuts-technique'],+ },+ ],+};++export default sidebars;diff --cc packages/docs/examples/3d/spinning-object.mdxindex 0000000000,0000000000..71e1e3a16bnew file mode 100644--- /dev/null+++ b/packages/docs/examples/3d/spinning-object.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Spinning object++description: Animate a reusable spinning 3D object, such as a disco ball.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Spinning object++++<PlannedExample category="3D" description="Animate a reusable spinning 3D object, such as a disco ball." />diff --cc packages/docs/examples/3d/video-texture.mdxindex 0000000000,0000000000..a732d8c879new file mode 100644--- /dev/null+++ b/packages/docs/examples/3d/video-texture.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Video texture++description: Use video as a texture in a 3D scene.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Video texture++++<PlannedExample category="3D" description="Use video as a texture in a 3D scene." />diff --cc packages/docs/examples/audio/audiogram.mdxindex 0000000000,0000000000..27c90719d6new file mode 100644--- /dev/null+++ b/packages/docs/examples/audio/audiogram.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Audiogram++description: Create a social-video audiogram layout with audio-reactive motion.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Audiogram++++<PlannedExample category="Audio" description="Create a social-video audiogram layout with audio-reactive motion." />diff --cc packages/docs/examples/audio/music-visualizer.mdxindex 0000000000,0000000000..ad3b3988a7new file mode 100644--- /dev/null+++ b/packages/docs/examples/audio/music-visualizer.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Music visualizer++description: Visualize audio amplitude or frequency data in a reusable graphic.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Music visualizer++++<PlannedExample category="Audio" description="Visualize audio amplitude or frequency data in a reusable graphic." />diff --cc packages/docs/examples/best-practices/drag-and-drop.mdxindex 0000000000,0000000000..2bc5c544fenew file mode 100644--- /dev/null+++ b/packages/docs/examples/best-practices/drag-and-drop.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Drag and drop++description: Demonstrate a useful drag-and-drop workflow for Remotion projects.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Drag and drop++++<PlannedExample category="Remotion best practices" description="Demonstrate a useful drag-and-drop workflow for Remotion projects." />diff --cc packages/docs/examples/best-practices/jumpcuts-technique.mdxindex 0000000000,0000000000..90d3b7ad8bnew file mode 100644--- /dev/null+++ b/packages/docs/examples/best-practices/jumpcuts-technique.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Jumpcuts technique++description: Show a practical jump-cut editing technique in Remotion.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Jumpcuts technique++++<PlannedExample category="Remotion best practices" description="Show a practical jump-cut editing technique in Remotion." />diff --cc packages/docs/examples/captions/lyrics-animation.mdxindex 0000000000,0000000000..670837774bnew file mode 100644--- /dev/null+++ b/packages/docs/examples/captions/lyrics-animation.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Lyrics animation++description: Synchronize animated lyric text with audio.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Lyrics animation++++<PlannedExample category="Captions" description="Synchronize animated lyric text with audio." />diff --cc packages/docs/examples/captions/tiktok-style-captions.mdxindex 0000000000,0000000000..272fc12dcbnew file mode 100644--- /dev/null+++ b/packages/docs/examples/captions/tiktok-style-captions.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: TikTok-style captions++description: Animate short-form captions with highlighted words.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# TikTok-style captions++++<PlannedExample category="Captions" description="Animate short-form captions with highlighted words." />diff --cc packages/docs/examples/effects/greenscreen.mdxindex 0000000000,0000000000..5d6489d6dcnew file mode 100644--- /dev/null+++ b/packages/docs/examples/effects/greenscreen.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Greenscreen++description: Key out a green background for a composited video effect.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Greenscreen++++<PlannedExample category="Effects" description="Key out a green background for a composited video effect." />diff --cc packages/docs/examples/effects/magnifier.mdxindex 0000000000,0000000000..8c9a449d57new file mode 100644--- /dev/null+++ b/packages/docs/examples/effects/magnifier.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Magnifier++description: Magnify part of the frame to draw attention.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Magnifier++++<PlannedExample category="Effects" description="Magnify part of the frame to draw attention." />diff --cc packages/docs/examples/effects/sticker-peel.mdxindex 0000000000,0000000000..daabfe1af9new file mode 100644--- /dev/null+++ b/packages/docs/examples/effects/sticker-peel.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Sticker peel++description: Animate a sticker peeling away from the screen.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Sticker peel++++<PlannedExample category="Effects" description="Animate a sticker peeling away from the screen." />diff --cc packages/docs/examples/effects/wiggle.mdxindex 0000000000,0000000000..074a8a93a3new file mode 100644--- /dev/null+++ b/packages/docs/examples/effects/wiggle.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Wiggle++description: Add organic wiggle motion to text or shapes.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Wiggle++++<PlannedExample category="Effects" description="Add organic wiggle motion to text or shapes." />diff --cc packages/docs/examples/index.mdxindex 314fab2901,0000000000..fde1b9258fmode 100644,000000..100644--- a/packages/docs/examples/index.mdx+++ b/packages/docs/examples/index.mdx@@@ -1,139 -1,0 +1,23 @@@+---+title: Examples++sidebar_label: Overview+description: Small, remixable motion graphics examples for Remotion.+---++# Examples+- Small, remixable motion graphics examples for Remotion.++This section will collect small, remixable motion graphics examples for Remotion.+- This section is a structure preview. Individual example pages will be added later.++The goal is to make examples that are easy to understand, easy to adapt, and useful as building blocks in real projects.+- <style>{`- .examplesCategories {- display: grid;- grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));- gap: 40px 56px;- margin-top: 40px;- }++## Status+- .examplesCategory h2 {- border: 0;- font-size: 1.35rem;- margin: 0 0 18px;- padding: 0;- }++This section is currently a structure preview. Individual example pages will be added later.+- .examplesCategory h2 a {- color: var(--ifm-heading-color);- text-decoration: none;- }++## What belongs here?+- .examplesCategory h2 a:hover {- color: var(--ifm-color-primary);- }++Examples should be focused on one visual idea, technique, or workflow. They should be actionable for Remotion users rather than full, highly specific video templates.+- .examplesCategory ul {- border-left: 2px solid var(--ifm-color-emphasis-200);- list-style: none;- margin: 0;- padding: 2px 0 2px 28px;- }++The final example format is still being defined. A good format should work both for previewing the result and for helping users quickly use the example in their own project.+- .examplesCategory li {- color: var(--ifm-font-color-base);- font-size: 1.1rem;- line-height: 1.45;- margin: 0 0 18px;- }-- .examplesCategory li:last-child {- margin-bottom: 0;- }- `}</style>-- <div className="examplesCategories">- <section className="examplesCategory">- <h2><a href="/examples/maps">Maps</a></h2>- <ul>- <li>Mapbox line from A to B</li>- <li>3D building</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/sport">Sport</a></h2>- <ul>- <li>Strava visualization</li>- <li>Mapbox / Athlete's Eye demo</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/storytelling">Storytelling</a></h2>- <ul>- <li>Paper.js highlight</li>- <li>News headline</li>- <li>Bar chart</li>- <li>Pie chart</li>- <li>Number wheel</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/audio">Audio</a></h2>- <ul>- <li>Music visualizer</li>- <li>Audiogram</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/captions">Captions</a></h2>- <ul>- <li>TikTok-style captions</li>- <li>Lyrics animation</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/motion-design-system">Motion design system</a></h2>- <ul>- <li>Lower third</li>- <li>Code example</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/effects">Effects</a></h2>- <ul>- <li>Greenscreen</li>- <li>Wiggle</li>- <li>Magnifier</li>- <li>Sticker peel</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/webgl">WebGL</a></h2>- <ul>- <li>Chromatic aberration</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/3d">3D</a></h2>- <ul>- <li>Spinning object, for example a disco ball</li>- <li>Video texture</li>- </ul>- </section>-- <section className="examplesCategory">- <h2><a href="/examples/best-practices">Remotion best practices</a></h2>- <ul>- <li>Drag and drop</li>- <li>Jumpcuts technique</li>- </ul>- </section>- </div>++If you have an idea, see [Suggest an example](/examples/suggest-an-example).diff --cc packages/docs/examples/maps/3d-building.mdxindex 0000000000,0000000000..757e717772new file mode 100644--- /dev/null+++ b/packages/docs/examples/maps/3d-building.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: 3D building++description: Show a 3D building as a reusable map-based visual element.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# 3D building++++<PlannedExample category="Maps" description="Show a 3D building as a reusable map-based visual element." />diff --cc packages/docs/examples/maps/mapbox-line-from-a-to-b.mdxindex 0000000000,0000000000..25e4c9b088new file mode 100644--- /dev/null+++ b/packages/docs/examples/maps/mapbox-line-from-a-to-b.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Mapbox line from A to B++description: Animate a route line between two points on a map.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Mapbox line from A to B++++<PlannedExample category="Maps" description="Animate a route line between two points on a map." />diff --cc packages/docs/examples/motion-design-system/code-example.mdxindex 0000000000,0000000000..4d750a6c95new file mode 100644--- /dev/null+++ b/packages/docs/examples/motion-design-system/code-example.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Code example++description: Show a code snippet as a polished motion graphic.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Code example++++<PlannedExample category="Motion design system" description="Show a code snippet as a polished motion graphic." />diff --cc packages/docs/examples/motion-design-system/lower-third.mdxindex 0000000000,0000000000..e4360bafe7new file mode 100644--- /dev/null+++ b/packages/docs/examples/motion-design-system/lower-third.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Lower third++description: Create a reusable lower-third title animation.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Lower third++++<PlannedExample category="Motion design system" description="Create a reusable lower-third title animation." />diff --cc packages/docs/examples/sport/mapbox-athletes-eye-demo.mdxindex 0000000000,0000000000..a3c3f6152fnew file mode 100644--- /dev/null+++ b/packages/docs/examples/sport/mapbox-athletes-eye-demo.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Mapbox / Athlete's Eye demo++description: Show an athlete-centered map animation inspired by an Athlete's Eye view.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Mapbox / Athlete's Eye demo++++<PlannedExample category="Sport" description="Show an athlete-centered map animation inspired by an Athlete's Eye view." />diff --cc packages/docs/examples/sport/strava-visualization.mdxindex 0000000000,0000000000..38c90c5d40new file mode 100644--- /dev/null+++ b/packages/docs/examples/sport/strava-visualization.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Strava visualization++description: Turn activity data into an animated sport visualization.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Strava visualization++++<PlannedExample category="Sport" description="Turn activity data into an animated sport visualization." />diff --cc packages/docs/examples/storytelling/bar-chart.mdxindex 0000000000,0000000000..a1ac1a34b6new file mode 100644--- /dev/null+++ b/packages/docs/examples/storytelling/bar-chart.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Bar chart++description: Animate values in a simple chart that can be reused in explainers.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Bar chart++++<PlannedExample category="Storytelling" description="Animate values in a simple chart that can be reused in explainers." />diff --cc packages/docs/examples/storytelling/news-headline.mdxindex 0000000000,0000000000..4b9f0b6781new file mode 100644--- /dev/null+++ b/packages/docs/examples/storytelling/news-headline.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: News headline++description: Animate a news-style headline for storytelling videos.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# News headline++++<PlannedExample category="Storytelling" description="Animate a news-style headline for storytelling videos." />diff --cc packages/docs/examples/storytelling/number-wheel.mdxindex 0000000000,0000000000..95746764fanew file mode 100644--- /dev/null+++ b/packages/docs/examples/storytelling/number-wheel.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Number wheel++description: Animate a changing number wheel for counters, stats, or rankings.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Number wheel++++<PlannedExample category="Storytelling" description="Animate a changing number wheel for counters, stats, or rankings." />diff --cc packages/docs/examples/storytelling/paper-js-highlight.mdxindex 0000000000,0000000000..10b85473d4new file mode 100644--- /dev/null+++ b/packages/docs/examples/storytelling/paper-js-highlight.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Paper.js highlight++description: Highlight part of a scene with a hand-drawn or paper-like annotation.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Paper.js highlight++++<PlannedExample category="Storytelling" description="Highlight part of a scene with a hand-drawn or paper-like annotation." />diff --cc packages/docs/examples/storytelling/pie-chart.mdxindex 0000000000,0000000000..a3afc4addcnew file mode 100644--- /dev/null+++ b/packages/docs/examples/storytelling/pie-chart.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Pie chart++description: Animate a simple pie chart for visual storytelling.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Pie chart++++<PlannedExample category="Storytelling" description="Animate a simple pie chart for visual storytelling." />diff --cc packages/docs/examples/suggest-an-example.mdxindex 0000000000,0000000000..727b613aadnew file mode 100644--- /dev/null+++ b/packages/docs/examples/suggest-an-example.mdx@@@ -1,0 -1,0 +1,46 @@@++---++title: Suggest an example++description: Suggest a Remotion example for the examples gallery.++---++++# Suggest an example++++Have an idea for a small, remixable Remotion example? We'd love to hear it.++++We are still defining the final example format. Suggestions are welcome even if you do not have code.++++## What makes a good example?++++A good example is:++++- Small enough to understand quickly++- Useful in more than one project++- Easy to remix++- Focused on one visual idea, technique, or workflow++- Possible to preview with a short rendered video or still image++- Actionable for a Remotion user++++## What to include++++When suggesting an example, include:++++- A short title++- What the viewer should see++- What makes it useful++- Links to inspiration, if any++- Required dependencies or assets, if known++- Whether you imagine it as a copy-pastable component, a larger project, or a workflow/tutorial-style example++++## Not a great fit++++These are usually less suitable:++++- Full video templates with many unrelated parts++- Highly specific branded videos++- Examples requiring private APIs or private assets++- Large apps with many moving parts++- Examples that cannot be previewed meaningfully++++## Submit your suggestion++++[Suggest an example on GitHub](https://github.com/remotion-dev/remotion/issues/new?title=%5BExample%20suggestion%5D%20&body=%23%23%23%20Example%20idea%0A%0A%23%23%23%20What%20should%20the%20viewer%20see%3F%0A%0A%23%23%23%20Why%20would%20this%20be%20useful%20to%20Remotion%20users%3F%0A%0A%23%23%23%20Inspiration%20or%20references%0A%0A%23%23%23%20Dependencies%20or%20assets%2C%20if%20known%0A%0A%23%23%23%20Preferred%20format%0A%0A-%20%5B%20%5D%20Copy-pastable%20component%0A-%20%5B%20%5D%20Larger%20project%0A-%20%5B%20%5D%20Workflow%2Ftutorial-style%20example%0A-%20%5B%20%5D%20Not%20sure)diff --cc packages/docs/examples/webgl/chromatic-aberration.mdxindex 0000000000,0000000000..510de99cfbnew file mode 100644--- /dev/null+++ b/packages/docs/examples/webgl/chromatic-aberration.mdx@@@ -1,0 -1,0 +1,10 @@@++---++title: Chromatic aberration++description: Apply a WebGL-style chromatic aberration effect.++---++++import {PlannedExample} from '../../src/components/Examples/PlannedExample';++++# Chromatic aberration++++<PlannedExample category="WebGL" description="Apply a WebGL-style chromatic aberration effect." />diff --cc packages/docs/src/components/Examples/PlannedExample.tsxindex 0000000000,0000000000..0a59d25c58new file mode 100644--- /dev/null+++ b/packages/docs/src/components/Examples/PlannedExample.tsx@@@ -1,0 -1,0 +1,58 @@@++import React from 'react';++++const container: React.CSSProperties = {++ border: '1px solid var(--ifm-color-emphasis-300)',++ borderRadius: 12,++ padding: 16,++ margin: '24px 0',++ backgroundColor: 'var(--ifm-color-emphasis-100)',++};++++const label: React.CSSProperties = {++ fontWeight: 700,++ marginBottom: 8,++};++++export const PlannedExample: React.FC<{++ category: string;++ description: string;++}> = ({category, description}) => {++ return (++ <>++ <p>{description}</p>++++ <div style={container}>++ <div style={label}>Planned example</div>++ <div>++ This page reserves a spot in the {category} category. The final++ example should follow the shared example format.++ </div>++ </div>++++ <h2>Preview</h2>++ <p>++ The implemented page should show a rendered preview, usually as a short++ looping video or still image. It should not require the docs website to++ bundle heavy example dependencies by default.++ </p>++++ <h2>Use it</h2>++ <p>++ The implemented page should provide a self-contained, copy-pastable++ TypeScript React component where possible.++ </p>++++ <h2>Customize</h2>++ <p>++ The implemented page should explain the most important knobs, such as++ timing, colors, text, dimensions, dependencies, or assets.++ </p>++++ <h2>Source</h2>++ <p>++ The implemented page should link to the source code and any required++ assets.++ </p>++ </>++ );++};