https://github.com/bronsondunbar/library-list-component
List component for React [NPM Package]
https://github.com/bronsondunbar/library-list-component
nodejs nodemodule react reactcomponent
Last synced: 23 days ago
JSON representation
List component for React [NPM Package]
- Host: GitHub
- URL: https://github.com/bronsondunbar/library-list-component
- Owner: bronsondunbar
- Created: 2018-06-27T12:48:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-27T12:54:22.000Z (almost 8 years ago)
- Last Synced: 2025-06-11T02:44:34.426Z (12 months ago)
- Topics: nodejs, nodemodule, react, reactcomponent
- Language: CSS
- Homepage: https://bronsondunbar.com/list-component-for-react-npm-package/
- Size: 120 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# List Component
List component for React
Install and save component as a dependency
```
npm install --save library-list-component
```
Import component into your app
```
import List from 'library-list-component'
```
Create an array of objects with the key being data
```
const listData = [
{
data: "Item one",
content: [
{
data: "Sub item one"
}
]
},
{
data: "Item two"
},
{
data: "Item three"
},
{
data: "Item four"
},
{
data: "Item five"
}
]
```
Render the component with the object array we created as well as any other props that are needed
```
render () {
const listData = [
{
data: "Item one",
content: [
{
data: "Sub item one"
}
]
},
{
data: "Item two"
},
{
data: "Item three"
},
{
data: "Item four"
},
{
data: "Item five"
}
]
return (
)
}
```
| Prop | Values |
| :--------------- | :------------------------------------- |
| listData | Object |
| listStyleType | default, circle, decimal, alpha, roman |
| listAlign | left, right, center |
| listInline | true or false |
| subListStyleType | default, circle, decimal, alpha, roman |