Skip to content

Wave Spinner

The WaveSpinner component displays a loading animation with five bars that animate in a wave-like pattern, creating a smooth and dynamic loading indicator.

Basic Usage

jsx
import { WaveSpinner } from "fancy-react-ui";

function App() {
  return <WaveSpinner />;
}

Live Demo:

Props

Prop NameTypeDefaultDescription
sizenumber40Size in pixels
colorstring#0066ffColor of the bars
speednumber0.8Animation speed in seconds
classNamestring""Additional CSS class names
styleobject{}Additional inline styles

Examples

Basic Wave Spinner

jsx
<WaveSpinner size={50} color="#F44336" speed={0.6} />

Custom Size and Color

jsx
<WaveSpinner size={60} color="#2196F3" />

Custom Speed

jsx
<WaveSpinner speed={1.2} color="#3F51B5" />

With Custom Styling

jsx
<WaveSpinner
  size={50}
  color="#33cc33"
  className="custom-wave"
  style={{ margin: "20px" }}
/>

Implementation Details

The WaveSpinner consists of five bars that animate in sequence to create a wave effect. Each bar uses the same animation but with different delays.

jsx
// Internal structure
<div className="wave-spinner">
  {/* 5 bars with wave animation */}
  {[...Array(5)].map((_, i) => (
    <div
      className="wave-bar"
      style={{
        backgroundColor: color,
        animationDuration: `${speed}s`,
      }}
    />
  ))}
</div>

Common Use Cases

Highlight typical scenarios where the spinner might be used:

  • Audio processing indicators
  • Data streaming states
  • Progress indicators
  • Loading transitions
  • Media player controls

Troubleshooting

Address potential issues developers might encounter, like:

  • Animation smoothness
  • Wave timing adjustments
  • Browser compatibility
  • Performance optimization
  • Mobile responsiveness

Explore similar components within the same library or ecosystem to find the best fit for your use case:

Released under the MIT License.