---
title: React Spinner Component
name: Spinner
description: Indicate the loading state of a component or page with CoreUI spinners, built entirely with HTML, CSS, and no JavaScript.
route: /components/spinner/
other_frameworks: spinner
---

## About

CoreUI "spinners" can be used to show the loading state in your projects. They're built only with HTML and CSS, meaning you don't need any JavaScript to create them. You will, however, need some custom JavaScript to toggle their visibility. Their appearance, alignment, and sizing can be easily customized with our amazing utility classes.

For accessibility purposes, each loader here includes `role="status"` and a nested `<span className="visually-hidden">Loading...</span>`.

## Border spinner

Use the border spinners for a lightweight loading indicator.

<ExampleSnippet component="SpinnerBorderExample" componentName="React Spinner" />

### Colors

The border spinner uses `currentColor` for its `border-color`. You can use any of our text color utilities on the standard spinner.

<ExampleSnippet component="SpinnerBorderColorsExample" componentName="React Spinner" />

## Growing spinner

If you don't fancy a border spinner, switch to the grow spinner. While it doesn't technically spin, it does repeatedly grow!

<ExampleSnippet component="SpinnerGrowExample" componentName="React Spinner" />

Once again, this spinner is built with `currentColor`, so you can easily change its appearance. Here it is in blue, along with the supported variants.

<ExampleSnippet component="SpinnerGrowColorsExample" componentName="React Spinner" />

## Alignment

CoreUI React spinners are built with `rems`, `currentColor`, and `display: inline-flex`. This means they can easily be resized, recolored, and quickly aligned.

### Margin

Use [margin utilities](https://coreui.io/bootstrap/docs/utilities/spacing/#margin-and-padding) like `.m-5` for easy spacing.

<ExampleSnippet component="SpinnerBorderMarginExample" componentName="React Spinner" />

### Placement

Use [flexbox utilities](https://coreui.io/bootstrap/docs/utilities/flex/), [float utilities](https://coreui.io/bootstrap/docs/utilities/float/), or [text alignment](https://coreui.io/bootstrap/docs/utilities/text/) utilities to place spinners exactly where you need them in any situation.

#### Flex

<ExampleSnippet component="SpinnerBorderPlacementFlexExample" componentName="React Spinner" />

<ExampleSnippet component="SpinnerBorderPlacementFlex2Example" componentName="React Spinner" />

#### Floats

<ExampleSnippet component="SpinnerBorderPlacementFloatsExample" componentName="React Spinner" />

#### Text align

<ExampleSnippet component="SpinnerBorderPlacementTextAlignExample" componentName="React Spinner" />

## Size

Add `size="sm"` property to make a smaller spinner that can quickly be used within other components.

<ExampleSnippet component="SpinnerSizeSmallExample" componentName="React Spinner" />

Or, use custom CSS or inline styles to change the dimensions as needed.

<ExampleSnippet component="SpinnerSizeCustomExample" componentName="React Spinner" />

## Buttons

Use spinners within buttons to indicate an action is currently processing or taking place. You may also swap the text out of the spinner element and utilize button text as needed.

<ExampleSnippet component="SpinnerButtonsExample" componentName="React Spinner" />

<ExampleSnippet component="SpinnerButtons2Example" componentName="React Spinner" />

## API

Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.

- [&lt;CSpinner /&gt;](./api/#cspinner)
