Bar Waveform
A customizable bar audio waveform visualization component.
Animate a bar waveform, often used for audio visualizations.
Installation
CLI
COMING SOON
Installation via npx shadcnui install clipkittt@bar-waveform
isn't quite ready yet.
For now, please follow the manual installation instructions.
Eventually users will be able to run the following command:
The GitHub task can be found here.
Manual
Create a new file, for example, at src/components/bar-waveform.tsx
(or your preferred location) and paste the following code into it.
Usage
Once the BarWaveform
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.
Define a Composition:
In your Remotion project's entry file (commonly src/Root.tsx
or src/index.ts
), import BarWaveform
and define a Composition
.
API Reference
The component exported as BarWaveform
(e.g., from apps/docs/registry/default/ui/bar-waveform.tsx
or your project's component path) accepts the following props to customize its appearance and animation:
Prop | Type | Default Value | Description |
---|---|---|---|
audioData | MediaUtilsAudioData | null | Audio data processed by @remotion/media-utils . |
numberOfSamples | number | 64 | Number of bars to render. |
barColor | string | "var(--foreground)" | Color of the bars. Accepts any valid CSS color value. |
barWidth | number | 5 | Width of each bar in pixels. |
barGap | number | 2 | Gap between each bar in pixels. |
barBorderRadius | string | number | 0 | Border radius for the bars. |
waveAmplitude | number | 100 | Maximum height of the bars. |
waveSpeed | number | 10 | Speed of the wave animation. Higher value means slower animation. |
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 . |