Hello Developers, In this blog, we will learn how we can implement react-suite loader component in react js which can be used in every API calls
First, make a new app by using the following command
npx create-react-app
Then install react suite library in your app using following command
npm i rsuite
Then import important files in your app js file
import { Loader } from 'rsuite'; import 'rsuite/dist/rsuite.min.css';
Then use Loader component like this
<Loader />
Demo:
You can also give content to the loader by using content property
<Loader content='Loading ...'/>
Demo:
The default position of the loader is horizontal but you can change it to vertical by using vertical property
<Loader content='Loading ...' vertical />
You can change loader size also by size property
<Loader content='Loading ...' vertical size='lg' /> <Loader content='Loading ...' vertical size='md' /> <Loader content='Loading ...' vertical size='sm' /> <Loader content='Loading ...' vertical size='xs' />
Demo: