GithubHelp home page GithubHelp logo

asfernandes-forks / react-loaders Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonjaques/react-loaders

0.0 2.0 0.0 1.15 MB

Lightweight wrapper around Loaders.css.

Home Page: http://jonjaques.github.com/react-loaders

License: MIT License

CSS 96.68% JavaScript 1.89% HTML 1.43%

react-loaders's Introduction

React Loaders

Lightweight wrapper around Loaders.css.

Demo

Install

npm install --save react-loaders loaders.css

Usage

Require the component.

var Loader = require('react-loaders').Loader;
// also available as `default`

function renderLoader() {
  return <Loader type="line-scale" active />
}

Props

static propTypes = {
  type: PropTypes.string,
  active: PropTypes.bool,
  color: PropTypes.string,
  innerClassName: PropTypes.string, // applied to the same div as .loader-inner.${type}
   																	// useful for advanced styling
  // className & style are implied
};

Sizing

Note: in ~2.x we had a size prop declared, but it never did anything so for 3.0 it has been removed. Why you ask? Well due to the way these are built by loaders.css, they are hardcoded to use specific pixel widths so sizing these natively would require rewriting that whole project.

Pro tip: you can resize these by simply passing style={{transform: 'scale(0.5)'}}.

CSS

Import any of the animations you want to use.

$primary-color: $my-brand-color;
// How you import this will depend heavily on your build setup
// If using webpack though, `~` refers to node_modules
// @import '~loaders.css/src/animations/line-scale.scss'
@import 'loaders.css/src/animations/line-scale.scss'

.loader-hidden {
  display: none;
}
.loader-active {
  display: block;
}

If @importing with Sass, make you use something like autoprefixer to add backwards compatibility.

react-loaders's People

Contributors

jonjaques avatar briantobo avatar jharris4 avatar delapouite avatar enet4 avatar

Watchers

Adriano dos Santos Fernandes avatar James Cloos 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.