react-toolbox/components/list/readme.md

22 lines
926 B
Markdown
Raw Normal View History

2015-07-06 13:53:37 +03:00
# List
```
var List = require('react-toolbox/components/list');
var data = [];
var template = function(data) {
<a href=/item/{data.id}>{data.name}</a>
};
<List dataSource={data} ItemFactory={template} />
```
## Properties
| Name | Type | Default | Description|
|:- |:-: | :- |:-|
2015-07-07 12:30:22 +03:00
| **className** | String | | Sets the class-styles of the Component.|
2015-07-06 13:53:37 +03:00
| **dataSource** | Array | required | JSON data representing all items in the list. |
| **ItemFactory** | Function | required | Callback who contains the item data representation.|
| **onClick** | Function | | Dispatch event when user clicks on any item sub-component.|
| **type** | String | | Type of the component, overwrite this property if you need set a different stylesheet.|