@feizheng/react-empty-state

1.0.4 • Public • Published

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

Name Type Required Default Description
className string false - The extended className for component.
centered bool false false If absoute center.
element element false - The core element(picture).
title union false '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: ()
  1. 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.

Readme

Keywords

Package Sidebar

Install

npm i @feizheng/react-empty-state

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

21.3 kB

Total Files

6

Last publish

Collaborators

  • afeiship