1.1.0 • Published 8 years ago

react-simple-directory v1.1.0

Weekly downloads
2
License
ISC
Repository
-
Last release
8 years ago

react-simple-directory

Builds a simple table in react from an array of Objects

pipeline status

Table of Contents

Installation

To install, you can use npm

$ npm install react-simple-directory

Usage

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

NameDescription
dataArray 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:

NameDescription
infoObject key to filter from data
displayString to display as the header title

Progress

Displays data from parent Subject module as a progress bar

<Progress total='100'/>
NameDescription
totalMaximum value

Style

TODO Implement AtomicCss Styling

Testing

Unit test are run using Jest

$npm run test

Authors

James Nicholls

1.1.0

8 years ago

1.0.0

8 years ago