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 .../> |
Build modern projects using Bootstrap 5 and Contrast
Trying to create components and pages for a web app or website from
scratch while maintaining a modern User interface can be very tedious.
This is why we created Contrast, to help drastically 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 Premium UI Kit Library featuring over 10000+ component variants.
Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for
building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.