@flive/react-ui-states
v4.0.1
Published
A utility component to use some of the best practices about the different states of an user interface
Downloads
1
Readme
react-ui-states
This React module to use some of the best practises about the different states of an user interface
Install
npm install @flive/react-ui-states
Code example
// success state
<UIStates data={{ name: 'Hello'}} loadingMessage="Loading some stuff" loading={loading} error={error} >
({ data }) => {
<Paragraph>data.name<Paragraph/>
}
</UIStates>
// loading state
<UIStates loading={true} loadingMessage="Loading some stuff" />
// error state
<UIStates
error={new Error('some error')}
errorMessage="Ooops something went wrong!"
/>
// blank state
<UIStates
data={[]}
blankMessage="Looks like there is something to see there"
/>
Licence
This project is licensed under a custom license. See the LICENSE file for details.