Circular Waveform
A customizable circular audio waveform visualization component.
Animate a circular waveform, often used for audio visualizations.
Installation
CLI
Manual
Create a new file, for example, at
src/components/clippkit/circular-waveform.tsx
(or your preferred location)
and paste the following code into it.
Update the import paths in your Remotion compositions if you placed the file in a different location than shown in the usage examples.
Usage
Once the CircularWaveform
component is added to your project (either via CLI or Manually), you can integrate it into your Remotion project by importing it and defining a Composition
.
Prerequisite
Ensure you have a Remotion project set up. If not, please refer to the Remotion documentation to get started.
Project Structure Example
Here’s an example folder layout showing where to place the component and how it fits into a typical Remotion project
Define a Composition
In your Remotion project's entry file (commonly src/Root.tsx
, src/index.tsx
, app/main.tsx
), import CircularWaveform
and define a Composition
.
API Reference
The component exported as CircularWaveform
(e.g., from apps/docs/registry/default/ui/circular-waveform.tsx
or your project's component path) accepts the following props to customize its appearance and animation:
Prop | Type | Default Value | Description |
---|---|---|---|
barCount | number | 60 | Number of bars (lines) in the waveform. |
barWidth | number | 5 | Width (strokeWidth) of each bar in pixels. |
barColor | string | "white" | Color of the bars. Accepts any valid CSS color value. |
waveAmplitude | number | 50 | Maximum length extension of the wave bars from the base radius. |
waveSpeed | number | 10 | Speed of the wave animation. Higher value means slower animation. |
randomness | number | 30 | Amount of random length variation applied to each bar. Set to 0 for no randomness. |
radius | number | 100 | Radius of the base circle from which waveform bars extend. |
centerOffset | { x?: number; y?: number } | { x: 0, y: 0 } | Offsets the center of the circular waveform from the center of its container. Useful for precise positioning. |
height | string | number | Video config height | Explicit height for the waveform container. Overrides video config height. |
width | string | number | Video config width | Explicit width for the waveform container. Overrides video config width. |
containerStyle | React.CSSProperties | {} | Custom CSS styles for the main container div . |
barStyle | React.CSSProperties | {} | Custom CSS styles for individual bars (SVG <line> elements). Applied to each bar. |