Skip to content

Border Spinner

This page demonstrates the BorderSpinner component. The spinner can be used as a loading indicator in your applications.

Usage Example

To render the BorderSpinner, simply include it in your JSX as shown below:

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

function App() {
  return (
    <div>
      <BorderSpinner />
    </div>
  );
}

Output:

Props

The following table describes the props that the BorderSpinner component accepts:

Prop NameDefault ValueTypeDescription
size40numberSets the size of the spinner.
color#0066ffstringSets the color of the spinner. Accepts any valid CSS color value.
secondaryColorrgba(0, 0, 0, 0.1)stringSets the secondary color of the spinner.
speed0.8numberSets the animation speed of the spinner. Accepts any valid CSS time value.
thickness4numberSpecifies the thickness of the spinner's line.
classNamenullstringApplies custom CSS classes to the spinner for additional styling.

TIP

All the listed props are optional. You can use them to customize the BorderSpinner to suit your application's needs.

Customization Example

Show how developers can customize the spinner using props or by overriding styles with CSS.

jsx
<BorderSpinner
  size={60}
  color="#ff6600"
  speed={1.2}
  className="my-custom-spinner"
/>

CSS for .my-custom-spinner:

css
.my-custom-spinner {
  border-radius: 50%;
}

Common Use Cases

Highlight typical scenarios where the spinner might be used:

  • Loading content (e.g., fetching data).
  • During page transitions.
  • As a visual placeholder for asynchronous operations.

Troubleshooting

Address potential issues developers might encounter, like:

  • Spinner not displaying (ensure size and color are valid).
  • Performance tips if the spinner causes rendering lag.

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

  • Chase Spinner: A dynamic spinner with a unique chasing dots animation.

Released under the MIT License.