1.0.19 • Published 6 years ago
the-repeatable v1.0.19
the-repeatable
Repeatable of the-component
Installation
$ npm install the-repeatable --save
Usage
'use strict'
import React from 'react'
import { TheRepeatable, TheRepeatableStyle } from 'the-repeatable'
import { TheSpinStyle } from 'the-spin'
class ExampleComponent extends React.PureComponent {
render () {
const data = new Array(25).fill(null).map((_, i) => ({id: i, name: `data-${i}`}))
return (
<div>
<TheSpinStyle/>
<TheRepeatableStyle/>
<TheRepeatable spinning={false}
data={data}
render={(data, i) => (
<div>This is data: {data.name}</div>
)}
/>
<h3>Horizontal</h3>
<TheRepeatable spinning={false}
data={data}
horizontal
render={(data, i) => (
<div>This is data: {data.name}</div>
)}
/>
<h3>Spinning</h3>
<TheRepeatable spinning={true}
data={data}
render={(data, i) => (
<div>This is data: {data.name}</div>
)}
/>
<h3>Empty</h3>
<TheRepeatable spinning={false}
data={[]}
render={(data, i) => (
<div>This is data: {data.name}</div>
)}
/>
</div>
)
}
}
export default ExampleComponent
Components
TheRepeatable
Repeatable of the-component
Props
Name | Type | Description | Default |
---|---|---|---|
ItemComponent | any | Item component | 'li' |
ListComponent | any | List component | 'ul' |
alt | node | Alt text when empty | 'Data Not Found' |
data | array | Items to render | [] |
horizontal | bool | Render as horizontal list | false |
introItem | node | Intro item | null |
keyFor | func | Get key for data | (data, i) => i |
outroItem | node | Outro item | null |
render | func | Renderer | null |
spinning | bool | Shows spinner | false |
TheRepeatableStyle
Style for TheRepeatable
Props
Name | Type | Description | Default |
---|---|---|---|
options | object | Style options | {} |
License
This software is released under the MIT License.
Links
1.0.19
6 years ago
1.0.17
6 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago