Giter Site home page Giter Site logo

react-loading-screen's Introduction

react-loading-screen

A React loading screen. Сan be used as a screen saver for the initial download of the application or as an overload screen for promises.

DEMO

demo.gif

Installation

npm install --save react-loading-screen

The modular approach of this library means you're much better off building it into your code with a module bundling system like browserify or webpack.

Browser Support

Basically IE9+.

Usage

const LoadingScreen = require('react-loading-screen');
// ... or with es2015
import LoadingScreen from 'react-loading-screen';

Server side rendering

Library uses styled components, so follow official docs to configurate, it`s very simple, go to instructions

Examples

For details about why the examples work, read the API documentation below.

You can also see full code of demo by looking in example/.

import React from 'react'
//...
import LoadingScreen from '../react-loading-screen'

//...
  <LoadingScreen
    loading={true}
    bgColor='#f1f1f1'
    spinnerColor='#9ee5f8'
    textColor='#676767'
    logoSrc='/logo.png'
    text='Here an introduction sentence (Optional)'
  > 
    // ...
    // here loadable content
    // for example, async data
    //<div>Loadable content</div>
  </LoadingScreen>

API

module is represented by a single component, let's call it LoadingScreen, import as shown above

LoadingScreen

Root component, it includes three subcomponents, you can control them through properties

props

some of props are REQUIRED, if not mentioned prop is OPTIONAL.

loading { bool }: the content of the page is loaded or not (required parameter).

bgColor { string }: background color of loading sreen. deault #ffffff .

spinnerColor { string }: spinner color. If empty param - not showing.

textColor { string }: text under spinner. default #676767.

logoSrc { string }: url of image. If empty param - not showing.

text { string }: background color of loading sreen. If empty param - not showing.

react-loading-screen's People

Contributors

mslavan avatar

Watchers

 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.