1.1.0 • Published 8 years ago
react-simple-directory v1.1.0
react-simple-directory
Builds a simple table in react from an array of Objects
Table of Contents
Installation
To install, you can use npm
$ npm install react-simple-directoryUsage
Import the component with the following lines.
import Directory, {
Subject,
Progress,
Switch
} from 'react-simple-directory'Example:
<Directory data={DATA}>
<Subject info='name' display='Name'/>
<Subject info='score' display='Score'>
<Progress total='100'/>
<Subject>
</Directory>A directory must have at least one subject child to display data
Properties
| Name | Description |
|---|---|
| data | Array of objects to display |
Methods
Component methods
Subject
Filters and displays data from the input data prop of the Directory component
<Subject info='score' display='Score'/>Properties:
| Name | Description |
|---|---|
| info | Object key to filter from data |
| display | String to display as the header title |
Progress
Displays data from parent Subject module as a progress bar
<Progress total='100'/>| Name | Description |
|---|---|
| total | Maximum value |
Style
TODO Implement AtomicCss Styling
Testing
Unit test are run using Jest
$npm run testAuthors
James Nicholls