A simple react loading animation component
npm install react-loading-dot
bash
npm install react-loading-dot
`
If you are using yarn
`bash
yarn add react-loading-dot
`
Import
`js
import { Loading } from 'react-loading-dot'
`
Properties
| Properties | Default | Description | Type |
| ---------- | -------------- | ---------------------------------------- | ------ |
| dots | 3 | Number of dots displayed | number |
| size | 1.5rem | The width and height of each dot | string |
| margin | 1rem | The horizontal distance between each dot | string |
| background | rgb(202,57,57) | The color of the dot | string |
| duration | 0.8s | The duration of the animation | string |
Usage
`jsx
import React, { useState } from 'react'
import { Loading } from 'react-loading-dot'
export const App: React.FC = () => {
const [loading, setLoading] = useState < boolean > true
return (
{loading ? : Display some contents...}
)
}
`
Uninstall
In your project directory, run
`bash
npm uninstall react-loading-dot
`
If you are using yarn
`bash
yarn remove react-loading-dot
``