react-powerplug
Give life to your dumb components.
Last updated 7 years ago by renatorib .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install react-powerplug 
SYNC missed versions from official npm registry.

React PowerPlug

npm stars tweet


React PowerPlug is a set of pluggable renderless components and helpers that provides different types of state and logic utilities that you can use with your dumb components. It creates state and passes down the logic to the children, so you can handle your data. Read about the Render Props pattern.

Highlights

  • :ok_hand: Dependency free
  • :electric_plug: Plug and play
  • :crystal_ball: Tree shaking friendly (ESM, no side effects)
  • :package: Super tiny (~3kb)
  • :books: Well documented
  • :beers: Bunch of awesome utilities
<summary>See quick examples</summary>
import { State, Toggle } from 'react-powerplug'
import { Pagination, Tabs, Checkbox } from './MyDumbComponents'

<State initial={{ offset: 0, limit: 10, totalCount: 200 }}>
  {({ state, setState }) => (
    <Pagination {...state} onChange={(offset) => setState({ offset })} />
  )}
</State>

<Toggle initial={true}>
  {({ on, toggle }) => (
    <Checkbox checked={on} onChange={toggle} />
  )}
</Toggle>

// You can also use a `render` prop instead

<Toggle
  initial={false}
  render={({ on, toggle }) => (
    <Checkbox checked={on} onChange={toggle} />
  )}
/>

Guide & Documentation

http://rena.to/react-powerplug/


Watch 'Rapid Prototyping with React PowerPlug' by Andrew Del Prete on egghead.io


Install

Node Module

yarn add react-powerplug
npm i react-powerplug

UMD

<script src="https://unpkg.com/react-powerplug/dist/react-powerplug.min.js"></script>

exposed as ReactPowerPlug

Contributors

Thanks goes to these wonderful people (emoji key):


Renato Ribeiro

💻 🎨 📖 ⚠️

Bogdan Chadkin

💻 📖 ⚠️ 🚇

Travis Arnold

💻 📖 🐛

Max Graey

💻

Mateusz Burzyński

🐛

Andy Edwards

💻

Andrea Vanini

🐛

Ivan Starkov

🐛

Sean Roberts

📖

Braden Kelley

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

Contribute

You can help improving this project sending PRs and helping with issues.
Also you can ping me at Twitter

Current Tags

  • 1.0.0                                ...           latest (6 years ago)
  • 1.0.0-rc.0                                ...           next (7 years ago)

18 Versions

  • 1.0.0                                ...           6 years ago
  • 1.0.0-rc.1                                ...           6 years ago
  • 0.1.6                                ...           7 years ago
  • 1.0.0-rc.0                                ...           7 years ago
  • 1.0.0-alpha.7                                ...           7 years ago
  • 1.0.0-alpha.6                                ...           7 years ago
  • 1.0.0-alpha.4                                ...           7 years ago
  • 1.0.0-alpha.3                                ...           7 years ago
  • 0.1.5                                ...           7 years ago
  • 1.0.0-alpha.2                                ...           7 years ago
  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
  • 0.0.1-alpha.1                                ...           7 years ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE