1.0.4 • Published 4 years ago

@feizheng/react-empty-state v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

react-empty-state

Empty state for react.

version license size download

installation

npm install -S @feizheng/react-empty-state

update

npm update @feizheng/react-empty-state

properties

NameTypeRequiredDefaultDescription
classNamestringfalse-The extended className for component.
centeredboolfalsefalseIf absoute center.
elementelementfalse-The core element(picture).
titleunionfalse'No data'The empty status title.

usage

  1. import css

    @import "~@feizheng/react-empty-state/dist/style.scss";
    
    // customize your styles:
    $react-empty-state-options: ()
  2. import js

    import NxOfflineSw from '@feizheng/next-offline-sw';
    import ReactGithubCorner from '@feizheng/react-github-corner';
    import ReactSwUpdateTips from '@feizheng/react-sw-update-tips';
    import React from 'react';
    import ReactDOM from 'react-dom';
    import ReactEmptyState from '@feizheng/react-empty-state';
    import './assets/style.scss';
    
    class App extends React.Component {
      state = { hasUpdate: false };
    
      componentDidMount() {
        NxOfflineSw.install({
          onUpdateReady: () => {
            this.setState({ hasUpdate: true });
          }
        });
      }
    
      render() {
        return (
          <div className="p-3 app-container">
            <ReactEmptyState centered title="暂无数据" />
            <ReactSwUpdateTips value={this.state.hasUpdate} />
            <ReactGithubCorner value="https://github.com/afeiship/react-empty-state" />
          </div>
        );
      }
    }
    
    ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago