Code Monkey home page Code Monkey logo

react-powerplug's Introduction

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

  • ๐Ÿ‘Œ Dependency free
  • ๐Ÿ”Œ Plug and play
  • ๐Ÿ”ฎ Tree shaking friendly (ESM, no side effects)
  • ๐Ÿ“ฆ Super tiny (~3kb)
  • ๐Ÿ“š Well documented
  • ๐Ÿป Bunch of awesome utilities
See quick examples
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

react-powerplug's People

Contributors

andarist avatar apuntovanini avatar baterson avatar beizhedenglong avatar coder054 avatar cramhead avatar denisborovikov avatar egoarka avatar everdimension avatar farskid avatar gnapse avatar istarkov avatar jaaberg avatar jedwards1211 avatar jeetiss avatar kpman avatar linusu avatar maxgraey avatar renatorib avatar rfviolato avatar rvcas avatar seanroberts avatar shoaibbhimani avatar slorber avatar souporserious avatar supernova23 avatar thekashey avatar trysound avatar txhawks avatar yaireo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.