1.0.2 • Published 7 years ago

react-loader-bubble v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

react-loader-bubble

A loading component for React.

Try it live!

Installation

npm i -S react-loader-bubble

Usage

Global Loading

import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import Loader from 'react-loader-bubble'
//...

const Demo = ({loading})=>(
    <Container>
        <Content>...</Content>
        //...
        <Loader loading={loading} />
    </Container>
)

ReactDOM.render(<Demo loading={true} />,document.getElementById('container'))

Partial Loading

Wrap your component where you want partial loading.

import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import Loader from 'react-loader-bubble'
//...

const Demo = ({loading})=>(
    <Container>
        <Content>...</Content>
        //...
        <Loader loading={loading}>
            <Panel>
                ...
            </Panel>
        </Loader>
    </Container>
)

ReactDOM.render(<Demo loading={true} />,document.getElementById('container'))

Props

PropertyTypeDefaultDescription
colorstring#3da5d9(light blue)Set color of loading component
sizestringnormalSet size of loading component, value could be small, normal or large.
loadingbooleanfalseSet as true and display loading.
textstring""Display loading text if value is not empty.
wrapbooleanfalseSet loading component whether be wrapped by a parent element.
indicatorReact NodenullCustomize loading indicator.
backgroundstringrgba(255, 255, 255, 0.3)Set background color of loading mask.

License

MIT