Spinner
Spinner
Spinner is animation that is used to keep visitors entertained while the page is still loading, which helps to increase the user experience.
Spinner Types
loading...
loading...
loading...
loading...
loading...
loading...
loading...
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
loading...
import React from "react";import { CDBSpinner, CDBContainer } from "cdbreact";export const Spinner = () => {return (<CDBContainer><CDBSpinner multicolor /></CDBContainer>);};
Size Variations
loading...
loading...
loading...
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
In this section you will find advanced information about the Spinner component. You will find out which modules are required, what are the possibilities of configuring the component, and what events and methods you can use to work with it.
Contrast Spinner Import Statement
You need to import the Contrast Spinner component first before using it.
import { CDBSpinner } from "cdbreact";
API Reference: Contrast Spinner Properties
The table below shows the configuration options of the CDBSpinner component.
| 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 size of the spinner. Select from one these keywords: big and 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 .../> |