{"id":21185076,"url":"https://github.com/jpsierens/reason-tags-input","last_synced_at":"2026-05-07T12:32:15.665Z","repository":{"id":57348981,"uuid":"116443505","full_name":"jpsierens/reason-tags-input","owner":"jpsierens","description":"A React component for inputting tags in a user friendly way","archived":false,"fork":false,"pushed_at":"2019-01-29T21:55:42.000Z","size":339,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T05:02:44.899Z","etag":null,"topics":["bucklescript","react","reasonml","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpsierens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-06T01:28:39.000Z","updated_at":"2019-01-29T21:55:44.000Z","dependencies_parsed_at":"2022-09-15T09:21:37.821Z","dependency_job_id":null,"html_url":"https://github.com/jpsierens/reason-tags-input","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsierens%2Freason-tags-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsierens%2Freason-tags-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsierens%2Freason-tags-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpsierens%2Freason-tags-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpsierens","download_url":"https://codeload.github.com/jpsierens/reason-tags-input/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639416,"owners_count":20323505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bucklescript","react","reasonml","webpack"],"created_at":"2024-11-20T18:14:37.567Z","updated_at":"2026-05-07T12:32:10.639Z","avatar_url":"https://github.com/jpsierens.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reason-tags-input [![Build Status](https://travis-ci.org/jpsierens/react-tags-input.svg?branch=master)](https://travis-ci.org/jpsierens/react-tags-input)\n\n\u003e A React component for inputting tags in a user friendly way\n\n![](showcase.gif)\n\n## Install\n```\n$ npm install --save reason-tags-input\n```\n\n## Usage\n```js\n// import the react component\nimport TagsInput from 'reason-tags-input';\n// optionally, import the default styles.\nimport 'reason-tags-input/build/styles.css';\n\nclass YourComponent extends Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      tags: []\n    }\n    this.handleTagInput = this.handleTagInput.bind(this);\n    this.handleTagRemove = this.handleTagRemove.bind(this);\n    this.handleTagsClear = this.handleTagsClear.bind(this);\n  }\n  handleTagInput(tag) {\n    this.setState({ tags: [...this.state.tags, tag]});\n  }\n  handleTagRemove(tag) {\n    this.setState({ tags: [...this.state.tags.filter(t =\u003e t !== tag)]});\n  }\n  handleTagsClear() {\n    this.setState({ tags: []});\n  }\n  render() {\n    return (\n      \u003cdiv\u003e\n        \u003cTagsInput\n\t  onTagInput={this.handleTagInput}\n\t  onTagRemove={this.handleTagRemove}\n          onClear={this.handleTagsClear} /\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n```\n\nProps:\n- ```onTagInput``` (Required) (callback) for when a tag is entered\n- ```onTagRemove``` (Required) (callback) for when a tag is removed\n- ```onClear``` (Optional) (callback) for when all tags are cleared\n- ```clearAllText``` (Optional) (string) use a different clear text than the default (\"Clear all\")\n\n\n[Click Here](https://github.com/jpsierens/react-tags-input-example) for an example you can run and play around with.\n\n## Made in ReasonML\nThis project is made in [ReasonML](https://reasonml.github.io/) and uses the [ReasonReact](https://reasonml.github.io/reason-react/) bindings to play along with React.\n\nhere's a nice book on [ReasonML](http://reasonmlhub.com/exploring-reasonml/)\n\n\n## Contribute\nRun this project:\n\n```\nnpm install\nnpm start\n# in another tab\nnpm run webpack\n```\n\nAfter 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.\n\n**For more elaborate ReasonReact examples**, please see https://github.com/reasonml-community/reason-react-example\n\n## The flow\nBy 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:\n\nBuckleScript -\u003e Webpack -\u003e output\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpsierens%2Freason-tags-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpsierens%2Freason-tags-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpsierens%2Freason-tags-input/lists"}