Skip to content

🎥 Make videos programmatically with React

starburst

Jonny Burgereab21bc0a691
diff --git a/packages/docs/docs/starburst-guide.mdx b/packages/docs/docs/starburst-guide.mdx
index 3a0a629308..3dacdff41f 100644
--- a/packages/docs/docs/starburst-guide.mdx
+++ b/packages/docs/docs/starburst-guide.mdx
@@ -7,7 +7,7 @@ crumb: 'Techniques'
# Starburst<AvailableFrom v="4.0.435"/>
-The [`<Starburst>`](/docs/starburst/starburst) component from [`@remotion/starburst`](/docs/starburst/api) renders a static WebGL-based retro starburst ray pattern. It can be used as a background or combined with animations for transitions.
+The [`<Starburst>`](/docs/starburst/starburst) component from [`@remotion/starburst`](/docs/starburst/api) renders a static WebGL-based retro starburst ray pattern.
<Demo type="starburst" />
@@ -24,42 +24,6 @@ const MyComp = () => {
};
```
-## Changing the number of rays
-
-The [`rays`](/docs/starburst/starburst#rays) prop controls how many rays appear in the pattern. Values from `2` to `100` are supported.
-
-```tsx twoslash title="ManyRays.tsx"
-import {Starburst} from '@remotion/starburst';
-import {AbsoluteFill} from 'remotion';
-
-// ---cut---
-const MyComp = () => {
- return (
- <AbsoluteFill style={{backgroundColor: 'black'}}>
- <Starburst rays={24} durationInFrames={30} />
- </AbsoluteFill>
- );
-};
-```
-
-## Changing the colors
-
-Use the [`colors`](/docs/starburst/starburst#colors) prop to set the ray colors. You can pass any number of colors (minimum 2) and they will be assigned to rays cyclically:
-
-```tsx twoslash title="CustomColors.tsx"
-import {Starburst} from '@remotion/starburst';
-import {AbsoluteFill} from 'remotion';
-
-// ---cut---
-const MyComp = () => {
- return (
- <AbsoluteFill style={{backgroundColor: 'black'}}>
- <Starburst colors={['#ff0066', '#6600ff', '#00ccff']} durationInFrames={30} />
- </AbsoluteFill>
- );
-};
-```
-
## Rotating the pattern
Use [`rotation`](/docs/starburst/starburst#rotation) to offset the angle of the rays in degrees:
@@ -78,40 +42,7 @@ const MyComp = () => {
};
```
-## Using as a transition
-
-Combined with [`<TransitionSeries.Overlay>`](/docs/transitions/transitionseries#transitionseriesoverlay), you can place a starburst at the cut point between two sequences without shortening the timeline.
-
-```tsx twoslash title="StarburstTransition.tsx"
-import {AbsoluteFill} from 'remotion';
-const Fill = ({color}: {color: string}) => <AbsoluteFill style={{backgroundColor: color}} />;
-
-// ---cut---
-import {Starburst} from '@remotion/starburst';
-import {TransitionSeries} from '@remotion/transitions';
-
-const StarburstTransition = () => {
- return (
- <TransitionSeries>
- <TransitionSeries.Sequence durationInFrames={60}>
- <Fill color="#0b84f3" />
- </TransitionSeries.Sequence>
- <TransitionSeries.Overlay durationInFrames={20}>
- <Starburst rays={12} colors={['#ffdd00', '#ff8800']} />
- </TransitionSeries.Overlay>
- <TransitionSeries.Sequence durationInFrames={60}>
- <Fill color="pink" />
- </TransitionSeries.Sequence>
- </TransitionSeries>
- );
-};
-```
-
-The starburst covers the full canvas, hiding the cut between scenes.
-
## See also
- [`<Starburst>` API reference](/docs/starburst/starburst)
- [`@remotion/starburst`](/docs/starburst/api)
-- [`<TransitionSeries.Overlay>`](/docs/transitions/transitionseries#transitionseriesoverlay)
-- [Transitions](/docs/transitioning)
diff --git a/packages/docs/docs/starburst/index.mdx b/packages/docs/docs/starburst/index.mdx
index a1e168a0d2..3ceaeef68b 100644
--- a/packages/docs/docs/starburst/index.mdx
+++ b/packages/docs/docs/starburst/index.mdx
@@ -3,11 +3,12 @@ image: /generated/articles-docs-starburst-index.png
id: starburst-api
slug: /starburst/api
title: '@remotion/starburst'
+crumb: API
---
# @remotion/starburst<AvailableFrom v="4.0.435" />
-Starburst ray effects for Remotion videos.
+Starburst ray effect for Remotion videos.
import {TableOfContents} from './table-of-contents';
diff --git a/packages/docs/docs/starburst/starburst.mdx b/packages/docs/docs/starburst/starburst.mdx
index 8c6b9833eb..a62f46f5fb 100644
--- a/packages/docs/docs/starburst/starburst.mdx
+++ b/packages/docs/docs/starburst/starburst.mdx
@@ -1,14 +1,18 @@
---
image: /generated/articles-docs-starburst-starburst.png
+id: starburst-component
+slug: /starburst/starburst
title: '<Starburst>'
crumb: '@remotion/starburst'
---
# &lt;Starburst><AvailableFrom v="4.0.435" />
-Renders a static WebGL-based retro starburst ray pattern.
+Renders a static WebGL-based retro starburst ray pattern.
Is a [`<Sequence>`](/docs/sequence) component under the hood and accepts its props.
+<Demo type="starburst" />
+
## Example
```tsx twoslash title="MyComp.tsx"
@@ -23,6 +27,8 @@ const MyVideo = () => {
rays={16}
colors={['#ffdd00', '#ff8800', '#ff4400']}
rotation={15}
+ width={1080}
+ height={1080}
/>
</AbsoluteFill>
);
@@ -33,12 +39,6 @@ const MyVideo = () => {
Apart from the props listed below, all props from [`<Sequence>`](/docs/sequence) except `children` and `layout` are accepted.
-### `durationInFrames?`
-
-The duration of the starburst in frames.
-
-If not specified, defaults to the duration of the composition or sequence, reading from [`useVideoConfig()`](/docs/use-video-config).
-
### `rays`
The number of rays in the starburst pattern. Must be between `2` and `100`.
diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts
index 165afa8310..294cc0ff3e 100644
--- a/packages/docs/sidebars.ts
+++ b/packages/docs/sidebars.ts
@@ -467,7 +467,7 @@ const sidebars: SidebarsConfig = {
type: 'doc',
id: 'starburst/starburst-api',
},
- items: ['starburst/starburst'],
+ items: ['starburst/starburst-component'],
},
{
type: 'category',
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 64f718e257..09fc6d396b 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -5601,6 +5601,33 @@ export const articles = [
noAi: false,
slug: 'standalone',
},
+ {
+ id: 'starburst',
+ title: 'Starburst',
+ relativePath: 'docs/starburst-guide.mdx',
+ compId: 'articles-docs-starburst-guide',
+ crumb: 'Techniques',
+ noAi: false,
+ slug: 'starburst',
+ },
+ {
+ id: 'starburst-api',
+ title: '@remotion/starburst',
+ relativePath: 'docs/starburst/index.mdx',
+ compId: 'articles-docs-starburst-index',
+ crumb: null,
+ noAi: false,
+ slug: 'starburst/api',
+ },
+ {
+ id: 'starburst/starburst',
+ title: '<Starburst>',
+ relativePath: 'docs/starburst/starburst.mdx',
+ compId: 'articles-docs-starburst-starburst',
+ crumb: '@remotion/starburst',
+ noAi: false,
+ slug: 'starburst/starburst',
+ },
{
id: 'staticfile-relative-paths',
title: 'staticFile() does not support relative paths',
diff --git a/packages/docs/static/generated/articles-docs-starburst-guide.png b/packages/docs/static/generated/articles-docs-starburst-guide.png
new file mode 100644
index 0000000000..b1cfc4e605
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-starburst-guide.png differ
diff --git a/packages/docs/static/generated/articles-docs-starburst-starburst.png b/packages/docs/static/generated/articles-docs-starburst-starburst.png
new file mode 100644
index 0000000000..0913d76912
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-starburst-starburst.png differ
diff --git a/packages/example/src/Starburst/index.tsx b/packages/example/src/Starburst/index.tsx
index 8556a5df77..351afb0699 100644
--- a/packages/example/src/Starburst/index.tsx
+++ b/packages/example/src/Starburst/index.tsx
@@ -5,20 +5,7 @@ import {AbsoluteFill} from 'remotion';
export const StarburstExample: React.FC = () => {
return (
<AbsoluteFill style={{backgroundColor: 'black'}}>
- <Starburst
- durationInFrames={60}
- rays={16}
- colors={['#ffdd00', '#ff8800']}
- />
- <Starburst
- durationInFrames={60}
- rays={12}
- colors={['#ff0066', '#6600ff', '#00ccff']}
- rotation={15}
- originOffsetX={0.2}
- originOffsetY={-0.1}
- smoothness={1}
- />
+ <Starburst rays={16} colors={['#ffdd00', '#ff8800']} />
</AbsoluteFill>
);
};