jQuery Plugin to Input custom tags and Select Box | selectize.js

Selection is a custom expandable user interface control that is based on jQuery. It’s helpful for tagging, contact lists, country locators, etc. The clock runs around 7 KB (compressed) The goal is to provide a robust and usable experience with a clean robust API.

custom select dropdown, custom select box css, css style select option dropdown, select> tag in html, custom select option css, input is which tag


  • The options search / smart sorting are efficiently recorded and sorted instantly (using a sifter). Want to search the item’s title and description? there is no problem.
  • The caret between elements is important sometimes. Use the arrow keys ← and ← to cycle through the selected items.
  • Select and delete multiple items at once. Press and hold the Mac option or ctrl in Windows to select more than one item to delete.
  • Díåcritîçs support is great for international environments.
  • Create Item Allows users to create items instantly (asynchronous save is supported; control locks until the callback is triggered).
  • Remote data upload when you have thousands of options and want the server to provide it by type of user.
  • Clean up API and code interface with it and make adjustments easily. We welcome withdrawal requests!
  • Extensible Plugin API for custom feature development (uses microplugin).
  • Touch Support works well with iOS 5+ devices. …

How to make use of it:

1. Include jQuery library and selectize.js within the head part.

<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/selectize.js"></script>

2. Include jQuery selectize CSS to model the plugin.

<link rel="stylesheet" href="selectize.css">

3. Create a container for the tags input.

<input type="text" id="input-tags" class="demo-default" value="awesome,neat">

4. Call the operate on the enter subject to initialize the plugin.


  // An array of the initial options available to select; array of objects. 
  // By default this is populated from the original input element. 
  // If your element is a <select> with <option>s specified this property gets populated automatically. 
  // Setting this property is convenient if you have your data as an array and want to automatically generate the <option>s.
  options: [],

  // Initial selected values.
  items: []

  // Option groups that options will be bucketed into. 
  // If your element is a <select> with <optgroup>s this property gets populated automatically. 
  // Make sure each object in the array has a property named whatever optgroupValueField is set to.
  optgroups: [],

  // Custom delimiter character to separate items
  delimiter: ',',
  splitOn: null, // regexp or string for splitting up values from a paste command

  // If false, items created by the user will not show up as available options once they are unselected.
  persist: true,

  // Enable or disable international character support.
  diacritics: true,

  // Allows the user to create new items that aren't in the initial list of options. 
  // This setting can be any of the following: true, false (disabled), or a function to process input. 
  // The function can take one of two forms: synchronous (with signature function(input){} or asynchronous (with signature function(input, callback). 
  // In the synchronous case, the function should return an object for the options (eg, with defaults: return { 'value': value, 'text': text };). 
  // The asynchronous version should invoke the callback with the result in the same format as the object above (eg, callback( { 'value': value, 'text': text});)
  create: false,

  // If true, when user exits the field (clicks outside of input), a new option is created and selected (if create setting is enabled).
  createOnBlur: false,

  // Specifies a RegExp or a string containing a regular expression that the current search filter must match to be allowed to be created. 
  // May also be a predicate function that takes the filter text and returns whether it is allowed.
  createFilter: null,

  // Toggles match highlighting within the dropdown menu.
  highlight: true,

  // Show the dropdown immediately when the control receives focus.
  openOnFocus: true,

  // The max number of items to render at once in the dropdown list of options.
  maxOptions: 1000,

  // The max number of items the user can select. Null allows an unlimited number of items
  maxItems: 1,

  // If true, the items that are currently selected will not be shown in the dropdown list of available options.
  hideSelected: false,

  // If true, the "Add..." option is the default selection in the dropdown.
  addPrecedence: false,

  // If true, the tab key will choose the currently selected item.
  selectOnTab: false,

  // If true, the load function will be called upon control initialization (with an empty search). Alternatively it can be set to 'focus' to call the load function when control receives focus.
  preload: false,

  // Allows empty options.
  allowEmptyOption: false,

  // If true, the dropdown will be closed after a selection is made.
  closeAfterSelect: false,

  // The animation duration (in milliseconds) of the scroll animation triggered when going [up] and [down] in the options dropdown.
  scrollDuration: 60,

  // The number of milliseconds to wait before requesting options from the server or null. 
  // If null, throttling is disabled. Useful when loading options dynamically while the user types a search / filter expression.
  loadThrottle: 300,

  // The class name added to the wrapper element while awaiting the fulfillment of load requests.
  loadingClass: 'loading',

  // The placeholder of the control (displayed when nothing is selected / typed). 
  // Defaults to input element's placeholder, unless this one is specified.
  placeholder: undefined,

  // The <option> attribute from which to read JSON data about the option.
  dataAttr: 'data-data',

  // The name of the property to group items by.
  optgroupField: 'optgroup',

  // The name of the property to use as the value when an item is selected.
  valueField: 'value',

  // The name of the property to render as an option / item label (not needed when custom rendering functions are defined).
  labelField: 'text',

  // The name of the property to disabled option and optgroup.
  disabledField: 'disabled',

  // The name of the property to render as an option group label (not needed when custom rendering functions are defined).
  optgroupLabelField: 'label',

  // The name of the option group property that serves as its unique identifier.
  optgroupValueField: 'value',

  // If truthy, Selectize will make all optgroups be in the same order as they were added (by the `$order` property). 
  // Otherwise, it will order based on the score of the results in each.
  lockOptgroupOrder: false,

  // A single field or an array of fields to sort by. 
  // Each item in the array should be an object containing at least a field property. 
  // Optionally, direction can be set to 'asc' or 'desc'. 
  // The order of the array defines the sort precedence.
  sortField: '$order',

  // An array of property names to analyze when filtering options.
  searchField: ['text'],

  // When searching for multiple terms (separated by space), this is the operator used. Can be 'and' or 'or' .
  searchConjunction: 'and',

  // multi or single
  mode: null,

  // Default classes
  wrapperClass: 'selectize-control',
  inputClass: 'selectize-input',
  dropdownClass: 'selectize-dropdown',
  dropdownContentClass: 'selectize-dropdown-content',

  // The element the dropdown menu is appended to. This should be 'body' or null. If null, the dropdown will be appended as a child of the Selectize control.
  dropdownParent: null,

  // Copy the original input classes to the dropdown element.
  copyClassesToDropdown: true,

  //  Custom rendering functions. Each function should accept two arguments: data and escape and return HTML (string or DOM element) with a single root element. 
  // The escape argument is a function that takes a string and escapes all special HTML characters. This is very important to use to prevent XSS vulnerabilities.
  render: {
    item: null,
    optgroup: null,
    optgroup_header: null,
    option: null,
    option_create: null


5. Callback capabilities.

load                 : null, // function(query, callback) { ... }
score                : null, // function(search) { ... }
onInitialize         : null, // function() { ... }
onChange             : null, // function(value) { ... }
onItemAdd            : null, // function(value, $item) { ... }
onItemRemove         : null, // function(value) { ... }
onClear              : null, // function() { ... }
onOptionAdd          : null, // function(value, data) { ... }
onOptionRemove       : null, // function(value) { ... }
onOptionClear        : null, // function() { ... }
onOptionGroupAdd     : null, // function(id, data) { ... }
onOptionGroupRemove  : null, // function(id) { ... }
onOptionGroupClear   : null, // function() { ... }
onDropdownOpen       : null, // function($dropdown) { ... }
onDropdownClose      : null, // function($dropdown) { ... }
onType               : null, // function(str) { ... }
onDelete             : null, // function(values) { ... }

6. API strategies.

// initialize the Selectize control
var $select = $('#input-tags').selectize(options);
// fetch the instance
var selectize = $select[0].selectize;

// add options, string or array

// update options
selectize.updateOption(value, data)

// remove an option

// clear options

// get options

// retrieve the jQuery element for the previous or next option, relative to the currently highlighted option
// the direction argument should be 1 for "next" or -1 for "previous"
selectize.getAdjacentOption(value, direction);

// refresh options

// clear all selected items

// get item

// add an item
selectize.addItem(value, silent);

// remove an item
selectize.removeItem(value, silent);

// create a new item
selectize.createItem(value, [triggerDropdown], [callback]);

// refresh items

// add a new optgroup
selectize.addOptionGroup(id, data);

// remove a optgroup

// clear all optgroups

// open the autocomplete dropdown

// close the autocomplete dropdown

// re-position the autocomplete dropdown

// destroy the instnace

// load options

// focus on the control

// move the focus out of the control

// lock/unlock the control

// disable/enable user input

// get the value of the control

// set the selected items
selectize.setValue(value, silent);

// set the selected item
selectize.setActiveItem($item, e);

// reset the number of max items to the given value

// move the caret to the specified position

// check if is reaching the limit

// clear cache

// update place holder

// add an event listener
selectize.on(event, handler);

// remove an event listener
selectize.off(event, handler);

// remove all event listeners

// trigger event listeners
selectize.trigger(event, ...);

7. Events.

selectize.on('initialize', function(){
  // do something

selectize.on('focus', function(){
  // do something

selectize.on('blur', function(){
  // do something

selectize.on('clear', function(){
  // do something

selectize.on('option_clear', function(){
  // do something

selectize.on('optgroup_clear', function(){
  // do something

selectize.on('destroy', function(){
  // do something

selectize.on('change', function(value){
  // do something

selectize.on('item_add', function(value, $item){
  // do something

selectize.on('item_remove', function(value, $item){
  // do something

selectize.on('option_add', function(value, data){
  // do something

selectize.on('option_remove', function(value){
  // do something

selectize.on('optgroup_add', function(id, data){
  // do something

selectize.on('optgroup_remove', function(id){
  // do something

selectize.on('dropdown_open', function($dropdown){
  // do something

selectize.on('dropdown_close', function($dropdown){
  // do something

selectize.on('type', function(str){
  // do something

selectize.on('load', function(data){
  // do something

jQuery Plugin For Custom Tags Input and Select Box, selectize.js Plugin/Github

See Demo And Download

Official Website(selectize): Click Here

This superior jQuery/javascript plugin is developed by selectize. For extra Advanced Usages, please go to the official website.

Related Posts


[Icon Picker] Iconpicker for Bootstrap 5 Icons Library

Bootstrap 5-based icon picker which supports any icon libraries like Bootstrap Icons, Font Awesome[fontawesome.com], etc. Must Read: 1000+ Pixel Perfect SVG Icons For Vue Components | Unicons How…


Bootstrap Multiple Image Upload with Preview and Delete | ImagesLoader

ImagesLoader is a standard bootstrap image upload plugin that provides an easy-to-use and nice-looking interface for uploading multiple images to a web server. Must Read: HTML 5…


A Lightweight jQuery Plugin for Animating Split-Flap Displays | fallblatt

fallblatt is a lightweight jQuery plugin for animating split screens. This jQuery plugin allows you to include such offers in your web application. Everything from virtual departure…


Dark & Light Switch Mode Toggle for Bootstrap 5

Switching to dark mode is done by toggling HTML tags that include -dark or -light as a category. It is made by manipulating the DOM with JavaScript. The text color also changes depending…


jQuery Plugin for Countdown Timer on HTML Page | SyoTimer

yoTimer jQuery plugin allows you to create digital style countdowns/periodic timers on the webpage, with callbacks support and timezone/translation customization. Features Periodic count with the specified period…


Dynamic, Data-driven Periodic Table built with Vue.js

Periodicity is a dynamic, data-driven periodic table created with Vue.js that uses D3 animations and graphs to show the beauty of periodic trends. Built With vue.js (component…