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.

NameTypeDefaultDescriptionExample
classNameStringAdds custom classesAdds custom classes<CDBSpinner className="myClass" ... />
tagStringdivChanges default input tag<CDBSpinner tag="input" ... />
sizeStringChanges the size of the spinner. Select from one these keywords: big and small.<CDBSpinner size="big" ... />
successBooleanfalseChanges the color of the spinner to green<CDBSpinner success .../>
secondaryBooleanfalseChanges the color of the spinner to purple<CDBSpinner secondary .../>
darkBooleanfalseChanges the color of the spinner to black<CDBSpinner dark .../>
infoBooleanfalseChanges the color of the spinner to teal<CDBSpinner info .../>
dangerBooleanfalseChanges the color of the spinner to red<CDBSpinner danger .../>
warningBooleanfalseChanges the color of the spinner to yellow<CDBSpinner warning .../>