Giter Site home page Giter Site logo

scrum-lab / react-activity Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ryohey/react-activity

0.0 0.0 0.0 1.27 MB

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

Home Page: http://lukevella.com/react-activity

License: MIT License

JavaScript 54.66% CSS 44.51% HTML 0.83%

react-activity's Introduction

React Activity Indicators

Build Status

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

preview

Demo & Examples

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

To run the examples locally, run:

npm install
npm start

Then open localhost:8000 in your browser.

Install

npm install react-activity

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

npm install react react-dom

Getting Started

Add the stylesheet to your app.

<link href="path/to/react-activity.css" />

If you are using a css preprocesser, you can import the stylesheet from the node_modules folder and it will be bundled with the rest of your css.

@import 'path/to/node_modules/react-activity/dist/react-activity.css';

Import the activity indicator you would like to use and insert it into one of your components as a child.

import React from 'react';
import {render} from 'react-dom';
import {Dots} from 'react-activity';

const App = React.createClass({
  render() {
    return <Dots size={20} />;
  }
});

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 'path/to/node_modules/react-activity/lib/Dots/Dots.css';

And

import React from 'react';
import {render} from 'react-dom';
import Dots from 'react-activity/lib/Dots';

const App = React.createClass({
  render() {
    return <Dots />;
  }
});

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

Activity Indicators

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

Properties

  • 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.

License

See LICENSE file.

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.