1.0.4 • Published 4 years ago
@feizheng/react-empty-state v1.0.4
react-empty-state
Empty state for react.
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
import css
@import "~@feizheng/react-empty-state/dist/style.scss"; // customize your styles: $react-empty-state-options: ()
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.