🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-text-spinners

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-text-spinners

text-spinners as a React component

1.2.1
Source
npm
Version published
Weekly downloads
209
-84.6%
Maintainers
1
Weekly downloads
 
Created
Source

react-text-spinners

This package wraps up text-spinners as an installable React component. View the examples here.

NPM

Install

npm install --save react-text-spinners

To run the examples, clone this repo and run the following commands in your terminal:

$ npm install
$ npm run examples:serve

Then open http://localhost:1234/ in a browser.

Usage

import React, { useEffect, useState } from "react";

import Spinner from "react-text-spinners";

export default function Example() {
    const [isLoading, setIsLoading] = useState(true);
    const [message, setMessage] = useState("");

    useEffect(() => {
        // this simulates the time it takes to make a web request
        setTimeout(() => {
            setMessage("hello world");
            setIsLoading(false);
        }, 1000);
    }, []);

    return (
        <div>{isLoading ? <Spinner theme="dots2" /> : <p>{message}</p>}</div>
    );
}

You can customize the output with additional props:

<Spinner theme="dots2" color="teal" size="5rem" title="Alternate hover text" />

License

MIT © j127

Keywords

react

FAQs

Package last updated on 16 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts