flashbang
Install
npm install flashbang
Query State
Stores state in the url. Useful for search pages. Must be rendered inside react-router v4.
const example = <div> <input value=statetest onChange= /> </div>; example;
Toggle
Toggle the display of data with three simple props!
<Toggle> <div toggle>Swap</div> <div on>This is shown when toggled</div> <div off>This is shown when not toggled</div></Toggle>
Paginate
Display 5 page numbers in either direction with next and previous buttons
Import the default css, or pass your own class names and use your own css!
;; <Paginate page=5 pages=25 createURL= `?page=` />;
Async Action
Changes text depending on promise status. Blocks onClick if a promise is in the middle of resolving, or finished.
<AsyncAction onClick= before=<div>Create</div> during=<div>Creating...</div> after=<span>Created!</span>/>
Examples
The examples
directory is a create-react-app
module, so you can npm start
or npm run build
to see the demos live.