GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - developit/tags-input: :bookmark: <input type="tags"> like magic

BranchesTags
Open more actions menu

Latest commit

 

History

57 Commits
57 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.babelrc
.babelrc
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.jshintrc
.jshintrc
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bower.json
bower.json
 
 
index.html
index.html
 
 
package.json
package.json
 
 
tags-input.css
tags-input.css
 
 
tags-input.css.map
tags-input.css.map
 
 
tags-input.js
tags-input.js
 
 
tags-input.js.map
tags-input.js.map
 
 

Repository files navigation

tags-input

NPM Version Bower Version Gitter Room

Features:

  • I said <input type="tags"> should be a thing.
  • With full keyboard, mouse and focus support.
  • Works with HTML5 pattern and placeholder attributes, too!
  • Native change and input ("live" change) events.
  • Using preact? (or react?) There's a wrapper called preact-token-input
  • Works in modern browsers and IE10+

Screenshot:

screenshot

JSFiddle Demo


Examples

It's easy to use! In addition to the example code, you'll also need to include tags-input.css - I didn't bundle it because that's a bit gross.

CommonJS:

var tagsInput = require('tags-input');

// create a new tag input:
var tags = document.createElement('input');
tags.setAttribute('type', 'tags');
tagsInput(tags);
document.body.appendChild(tags);

// enhance an existing input:
tagsInput(document.querySelector('input[type="tags"]'));

// or just enhance all tag inputs on the page:
[].forEach.call(document.querySelectorAll('input[type="tags"]'), tagsInput);

HTML Example:

<link rel="stylesheet" href="tags-input.css">
<script src="tags-input.js"></script>

<form>
	<label>
		Add some
		<input name="hashtags" type="tags" pattern="^#" placeholder="#hashtags">
	</label>
</form>

<script>[].forEach.call(document.querySelectorAll('input[type="tags"]'), tagsInput);</script>

About

🔖 <input type="tags"> like magic

jsfiddle.net/developit/d5w4jpxq/

Topics

domdom-componentsinputinput-methodtagtag-inputtagging

Resources

Readme
MIT license
Activity

Stars

332 stars

Watchers

7 watching

Forks

45 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.