1.0.19 • Published 5 years ago

the-repeatable v1.0.19

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

the-repeatable

Build Status npm Version JS Standard

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

NameTypeDescriptionDefault
ItemComponentanyItem component'li'
ListComponentanyList component'ul'
altnodeAlt text when empty'Data Not Found'
dataarrayItems to render[]
horizontalboolRender as horizontal listfalse
introItemnodeIntro itemnull
keyForfuncGet key for data(data, i) => i
outroItemnodeOutro itemnull
renderfuncRenderernull
spinningboolShows spinnerfalse

TheRepeatableStyle

Style for TheRepeatable

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links

1.0.19

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago