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

reason-tags-input

v0.1.3

Published

> A React component for inputting tags in a user friendly way

Readme

reason-tags-input Build Status

A React component for inputting tags in a user friendly way

Install

$ npm install --save reason-tags-input

Usage

// import the react component
import TagsInput from 'reason-tags-input';
// optionally, import the default styles.
import 'reason-tags-input/build/styles.css';

class YourComponent extends Component {
  constructor(props) {
    super(props);
    this.state = {
      tags: []
    }
    this.handleTagInput = this.handleTagInput.bind(this);
    this.handleTagRemove = this.handleTagRemove.bind(this);
    this.handleTagsClear = this.handleTagsClear.bind(this);
  }
  handleTagInput(tag) {
    this.setState({ tags: [...this.state.tags, tag]});
  }
  handleTagRemove(tag) {
    this.setState({ tags: [...this.state.tags.filter(t => t !== tag)]});
  }
  handleTagsClear() {
    this.setState({ tags: []});
  }
  render() {
    return (
      <div>
        <TagsInput
	  onTagInput={this.handleTagInput}
	  onTagRemove={this.handleTagRemove}
          onClear={this.handleTagsClear} />
      </div>
    );
  }
}

Props:

  • onTagInput (Required) (callback) for when a tag is entered
  • onTagRemove (Required) (callback) for when a tag is removed
  • onClear (Optional) (callback) for when all tags are cleared
  • clearAllText (Optional) (string) use a different clear text than the default ("Clear all")

Click Here for an example you can run and play around with.

Made in ReasonML

This project is made in ReasonML and uses the ReasonReact bindings to play along with React.

here's a nice book on ReasonML

Contribute

Run this project:

npm install
npm start
# in another tab
npm run webpack

After you see the webpack compilation succeed (the npm run webpack step), open up the nested html files in src/* (no server needed!). Then modify whichever file in src and refresh the page to see the changes.

For more elaborate ReasonReact examples, please see https://github.com/reasonml-community/reason-react-example

The flow

By doing npm start you are running the Reason compiler and watching for changes to Reason files (.re). When you make a change to one, it compiles it to JavaScript (.bs.js) through BuckleScript. When that happens, webpack picks up and does it's thing and throws the bundle to build/index.js. So it's a 2 step process:

BuckleScript -> Webpack -> output