Coder Social home page Coder Social logo

bootstrap-tag's Introduction

Tags for Twitter Bootstrap 2.x

bootstrap-tag is a javascript plugin that makes it easy to create simple, beautiful tag inputs with the help of Twitter Bootstrap.

Usage

Just like in Bootstrap you can activate it without any JavaScript, just by adding a data-attribute, you can make it automatically work.

Simply add data-provide="tag". You can set options via data-attributes, too.

<input class="input-tag" type="text" name="tags" data-provide="tag">

Alternatively, you can initialize via JavaScript:

$('.input-tag').tag(options);

Options

  • caseInsensitive (optional) Whether or not search and matching should be case insensitive. Default to true.
  • allowDuplicates (optional) Whether or not to allow duplicate tags. Defaults to false.
  • source (optional) The data source to query against. May be an array of strings or a function. Defaults to [].
  • autocompleteOnComma (optional) Autocomplete on comma type with the first suggested value (if any). Default to false. Thank you, knightq!

Events

  • added Triggered immediately after a tag is successfully added. The event handler will be passed the value that was added.
  • removed Triggered immediately after a tag is successfully removed. The event handler will be passed the value that was removed.

Example

You can try it here. I've also included the example in the docs folder.

bootstrap-tag's People

Contributors

fdeschenes avatar knightq avatar davidherse avatar lstachowiak avatar

Watchers

Jack Stenson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.