README
react-empty-state
Empty state for react.
installation
npm install -S @jswork/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 | any | false | '暂无数据' | The empty status title. |
selectable | bool | false | true | The element if can select/drag. |
usage
- import css
@import "~@jswork/react-empty-state/dist/style.css";
// or use sass
@import "~@jswork/react-empty-state/dist/style.scss";
// customize your styles:
$react-empty-state-options: ()
- import js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactEmptyState from '@jswork/react-empty-state';
import './assets/style.scss';
class App extends React.Component {
render() {
return (
<ReactDemokit
className="p-3 app-container"
url="https://github.com/afeiship/react-empty-state">
<ReactEmptyState onItemClick={e=>{console.log('item click');}} centered title="暂无数据" />
</ReactDemokit>
);
}
}
ReactDOM.render(<App />, document.getElementById('app'));
documentation
license
Code released under the MIT license.