1.0.6 • Published 5 years ago

react-listable v1.0.6

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

react-listable

A collection of react components that iterates over the each prop and renders the render prop. Demo

npm.io

Overview

const users = [{ name: 'Victor 😎', age: 10 }]
<For each={users} render={
  ({ name, age }) => <p>{ name }, { age }</p>
}/>

Installation

You can use npm/yarn to install

npm install react-listable

Documentation

For

<For 
  each={state.users} 
  loader={() => <div>loading</div>}
  render={
    ({ name, age }) => <p>{ name }, { age }</p>
  }/>

Ul

<Ul 
  className="list"
  each={state.users} 
  setActive={({ name }) => name === 'Maria 🙍'}
  render={
    ({ name, age }) => <p>{ name }, { age }</p>
  }/>

Ol

<Ol 
  className="list"
  each={state.users} 
  render={
    ({ name, age }) => <p>{ name }, { age }</p>
  }/>

See the full documentation and live examples at https://victorvoid.me/react-listable

License

The code is available under the MIT License.

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago