Spinner
React Bootstrap 5 Spinner
React Bootstrap 5 Spinner is an animation that helps improve the user experience by keeping visitors engaged while the page is loading.
Importing the React Bootstrap 5 Spinner Component
You import CDBSpinner
into your project to use the Contrast React Bootstrap 5 Spinner component.
import { CDBSpinner } from 'cdbreact';
Default Spinner
The CDBSpinner
component takes in characteristics like danger and success, which are 'color' prop values, to give the spinner a background color.
import React from 'react';import { CDBSpinner, CDBContainer } from 'cdbreact';
export const Spinner = () => { return ( <CDBContainer> <CDBSpinner /> <CDBSpinner danger /> <CDBSpinner success /> <CDBSpinner warning /> <CDBSpinner info /> <CDBSpinner dark /> <CDBSpinner secondary /> </CDBContainer> );};
Multicolor Spinner
To give your spinner multiple colors, use the multicolor
attribute.
import React from 'react';import { CDBSpinner, CDBContainer } from 'cdbreact';
export const Spinner = () => { return ( <CDBContainer> <CDBSpinner multicolor /> </CDBContainer> );};
Size Variations
Use the size
attribute to indicate how big or small your spinner should be.
import React from 'react';import { CDBSpinner, CDBContainer } from 'cdbreact';
export const Spinner = () => { return ( <CDBContainer> <CDBSpinner size="big" /> <CDBSpinner secondary /> <CDBSpinner success size="small" /> </CDBContainer> );};
API Reference: Contrast React Bootstrap 5 Spinner Props
This section will expand on the props you'll be using with the Contrast React Bootstrap 5 Spinner component. You'll learn what these props do, how to utilize them, and what their default values are.
The table below details the CDBSpinner 's
other prop selections.
Name | Type | Default | Description | Example |
---|---|---|---|---|
className | String | Adds custom classes | Adds custom classes | <CDBSpinner className="myClass" ... /> |
tag | String | div | Changes default input tag | <CDBSpinner tag="input" ... /> |
size | String | Changes the spinner's size. Choose one of the following keywords: 'large' or'small'. | <CDBSpinner size="big" ... /> | |
success | Boolean | false | Changes the color of the spinner to green | <CDBSpinner success .../> |
secondary | Boolean | false | Changes the color of the spinner to purple | <CDBSpinner secondary .../> |
dark | Boolean | false | Changes the color of the spinner to black | <CDBSpinner dark .../> |
info | Boolean | false | Changes the color of the spinner to teal | <CDBSpinner info .../> |
danger | Boolean | false | Changes the color of the spinner to red | <CDBSpinner danger .../> |
warning | Boolean | false | Changes the color of the spinner to yellow | <CDBSpinner warning .../> |
Trying to build out all user interfaces and components for your website or web app from scratch can become a very tedious task. A huge reason why we created Contrast Bootstrap to help reduce the amount of time we spend doing that, so we can focus on building some other aspects of the project. Contrast Bootstrap PRO consists of a UI Kit featuring over 10000+ component variants. Together with a template of 5 admin dashboards and 23+ additional multipurpose pages template for building almost any type of website or web app. You can view a demo and learn more about Contrast by clicking here.Download the free react template

Contrast Bootstrap PRO was built using the most popular CSS framework Bootstrap to help build your next landing, admin SAAS, prelaunch etc project with a clean, prebuilt and well documented template and UI components.Learn more about Contrast