The CircularSpinner
component is a customizable loading spinner built using React and styled-components. It features smooth animations and adjustable properties for color, speed, size, and direction of rotation.
To use the CircularSpinner
component, you need to have React and styled-components installed in your project. You can install styled-components using npm:
npm install styled-components
};
The CircularSpinner
component accepts the following props:
Prop | Type | Default | Description |
---|---|---|---|
color1 |
string |
#D97292 |
Primary color of the spinner. |
color2 |
string |
blue |
Secondary color of the spinner. |
opacity1 |
number |
0.5 |
Opacity for the primary color. |
opacity2 |
number |
1 |
Opacity for the secondary color. |
speed |
string |
2s |
Speed of the rotation animation (CSS time format). |
direction |
string |
-360deg |
Direction of the rotation (e.g., -360deg , 360deg ). |
size |
string |
100 |
Size of the spinner (width and height in pixels). |