Skip to content

WebNinjaDeveloper.com

Programming Tutorials




Menu
  • Home
  • Youtube Channel
  • Official Blog
  • Nearby Places Finder
  • Direction Route Finder
  • Distance & Time Calculator
Menu

React.js react-loader-spinner Example to Add Async Loading Spinner Animation in Javascript

Posted on January 23, 2023

 

 

Welcome folks today in this blog post we will be showing loading spinners using the react-loader-spinner library in react.js. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to make a new react.js app as shown below

 

 

npx create-react-app sampleapp

 

 

cd sampleapp

 

 

And after that you need to install the below libraries using the below command as shown below

 

 

npm i react-loader-spinner

 

 

And after that you need to see the directory structure of the react.js app as shown below

 

 

 

 

And now you need to copy paste the below code inside the App.js file as shown below

 

 

App.js

 

 

JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import React from "react";
import { Audio } from "react-loader-spinner";
import "./styles.css";
 
export default function App() {
  return (
    <div className="App">
      <Audio
        height="80"
        width="80"
        radius="9"
        color="green"
        ariaLabel="loading"
        wrapperStyle
        wrapperClass
      />
    </div>
  );
}

 

 

As you can see in the above code we are importing the react-loader-spinner library and then we are rendering the audio widget and inside it we are passing the width and height and also we are attaching the radius as shown below

 

 

 

Recent Posts

  • Angular 14/15 JWT Login & Registration Auth System in Node.js & Express Using MongoDB in Browser
  • Build a JWT Login & Registration Auth System in Node.js & Express Using MongoDB in Browser
  • React-Admin Example to Create CRUD REST API Using JSON-Server Library in Browser Using Javascript
  • Javascript Papaparse Example to Parse CSV Files and Export to JSON File and Download it as Attachment
  • Javascript Select2.js Example to Display Single & Multi-Select Dropdown & Fetch Remote Data Using Ajax in Dropdown
  • Angular
  • Bunjs
  • C#
  • Deno
  • django
  • Electronjs
  • java
  • javascript
  • Koajs
  • kotlin
  • Laravel
  • meteorjs
  • Nestjs
  • Nextjs
  • Nodejs
  • PHP
  • Python
  • React
  • ReactNative
  • Svelte
  • Tutorials
  • Vuejs




©2023 WebNinjaDeveloper.com | Design: Newspaperly WordPress Theme