Giter VIP home page Giter VIP logo

react-activity's Introduction

React Activity Indicators

Build Status NPM Downloads

A library of activity indicators in the form of React components.

  • ๐Ÿ”ฅ 8 different animations to choose from
  • ๐ŸŽจ Customizable color, size and animation speed
  • ๐Ÿ•บ Small footprint. Only ~7kB if you add a single component to your bundle.
  • ๐Ÿ†• TypeScript support

preview

Demo & Examples

Live demo: https://react-activity.lukevella.com

To run the examples locally, run:

yarn && yarn start

Then open http://localhost:8000 in your browser.

Install

React, ReactDOM are peer dependencies, if you haven't already installed them use:

npm install react-activity react react-dom

Getting Started

Import the activity indicators you would like to use along with its corresponding css file.

import React from "react";
import { render } from "react-dom";

import { Dots } from "react-activity";
import "react-activity/dist/library.css";

const App = () => {
  return <Dots />;
};

render(<App />, document.getElementById("app-container"));

Optimizing Your Build

To avoid bundling unnecessary code and css to your project, you can import the activity indicators individually.

import React, { Component } from "react";
import { render } from "react-dom";

import Dots from "react-activity/dist/Dots";
import "react-activity/dist/Dots.css";

const App = () => {
  return <Dots />;
};

render(<App />, document.getElementById("app-container"));

Activity Indicators

  • Dots
  • Levels
  • Sentry
  • Spinner
  • Squares
  • Digital
  • Bounce
  • Windmill

Props

All indicators support the following props:

  • size: number All dimensions of the activity indicators are specified in ems so play around with a value until you find something that suits your needs.
  • color: string The active color of the indicator.
  • speed: number (default: 1) The relative animation speed of the indicator.
  • animating: boolean (default: true) Whether to show the indicator (true) or hide it (false).
  • style: React.CSSProperties (default: undefined) Custom styling to be applied to the container.
  • className: string (default: undefined) Custom className to be applied to the container.

License

See LICENSE file.

react-activity's People

Contributors

lukevella avatar dependabot[bot] avatar ryohey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.