npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-bicon

v1.1.0

Published

A data-binding library for react

Readme

react-bicon

A data-binding library for react

example

var react = require("react");
var {Context,Binding} = require("react-bind-context");
var TextField = require("./my_textfield_component");

class App extends react.Component{
	constructor(props,context){
		super(props,context);
		this.data = {firstname:"Max",lastname:"Muster"}
	}
	render(){
		return <Context target=this.data>
			<div className="my-form">
				<Binding name="firstname">
					<TextField>
				</Binding>
				<Binding name="lastname">
					<TextField>
				</Binding>
			</div>
		</Context>
	}
}

So, basically, you render a Context component containing one or more Binding components containing one component capable of handling the binding.

To Context you pass the data-object using the target prop. The Binding components need the name prop, which property on the data-object holds the value they should manage.

A component is capable of handling the binding when it takes a value prop and a onChange prop. The value prop holds the value of the property of the data-object. The onChange prop is a function that must be called with the new value as first argument as soon as the value was changed in the component.

This means, that a normal input does not support the binding, since it calls onChange with an event-object as first parameter. In order to make it work, you need to wrap it to support the API.

reference

Context

  • target (object): The object holding the data you want to bind your UI to.
  • name (string): You can also nest Context components. On nested ones, you can set a name instead of target. It then takes its target from the parent context.
  • validator (Validator) (optional): A validator to validate the data everytime data was changed.

Binding

  • name (string): The name of the property of the context's data-object you want to bind to

Bindable components

In order to make a Component bindable, it has to support the following API:

  • value (any): The value this component must render and make editable
  • onChange(value) (any): The function this component must call when the value was changed, with the new value as first argument
  • errors (array of Error objects): If validator was specified on Context then you get an array of errors on this field. It's zero-length if there aren't any.

Validator

A validator is any function that takes an object as first parameter and returns an array of zero or more Errors.

Error

Errors are returned by a Validator's validate function. The are read-only objects. They have the following properties:

  • fields (string[]): An array of property names this error applies to
  • message (string): A string describing the error