Tokenfield
Input field with tagging/token/chip capabilities written in raw JavaScript. Tokens in OS X or Chips in Android - small UI elements which are inserted into various input fields that often combine with autocomplete functionality. Tokens allow designers to display extra information about input. Tokenfield intended use case is work with structured data. More specifically, it expects autocomplete data to be JSON formatted array of objects where each object contains token ID and token Name.
Basic usage

Tokenfield could be applied to any visible <input> element that allows users to input text or number. Without additional options, this Tokenfield would allow users to add multiple token items without any specific restrictions.

Input group with addons

Token input field is adapted for input groups. It shares global input styling with .form-control elements for consistency and can be used with different elements: inputs, selects, text addons, button addons, icons etc.

Placeholder

You can either use a regular input field placeholder or set it in tokenfield configuration. If placeholder option is set to null (default), tokenfield will try to use placeholder attribute from the original element set in el.

Disable custom tokens

By default, token field allows user to add custom tokens instead of using preset list of tokens or tokens retrieved from the server. To disable this behaviour and limit selection to the tokens from the list. set newItems option to false.

Single token selection

Tokenfield allows user to select or add multiple number of tokens, in fact there is no limit. In some cases you can disable multiple tokens in the field and allow only 1. To do that, set multiple optino to false.

Limit number of items

You can also limit the number of selected tokens in the input field. Use maxItems: [number] to add a limit. The default value is 0, which allows user to enter as many items as possible. Here you can't enter more than 2 tokens.

Allow matching only from the beginning

Tokenfield can be configured to do matching only from the beginning of the string - it compiles match regex to basicall this format: /^{value}/i. To use this feature, set matchStart option to true.

Allow matching only from the end

Tokenfield can be configured to do matching only from the end of the string - it compiles match regex to basicall this format: /{value}$/i. To use this feature, set matchEnd option to true.

Add item on blur

If addItemOnBlur option is set to true, new item will be added to the tokenfield on input blur. Either sets new item or first match from suggested list. To test it, type something and click outside the field.

Custom delimiters

You can specify certain characters/sets of characters to be used as delimiters during tokenization or input events on tokenfield. Use delimiters option with an array of delimiters. In this example new token is added every time you press , key.

Add items on paste

If addItemsOnPaste config option is set to true, new items will be added to the tokenfield on paste. Tokenization happens using delimiters options listed above. Try to copy and paste some text to see it in action.

Minimum characters to display menu

By default, user needs to type at least 2 characters to see the list of matches. This number can be controlled with minChars option. This example allows you to enter 1 character to see the list of all matches. Type "A" to see it in action.

Remote data source

Tokenfield also works with remote data source stored in JSON file. Options are set as properties of an object assigned to remote property of the parent options object. In this example all tokens are loaded from car_brands.json file.

Remote autocomplete with data remapping

Tokenfield has several overridable methods which allow user to remap given token data or change how some elements are rendered. In this example Tokenfield fetches remote data for autocomplete and renders labels in capital letters

Activity
New notifications
James has completed the task Submit documents from Onboarding list
2 hours ago
Margo has added 4 users to Customer enablement channel
3 hours ago
Subscription #466573 from 10.12.2021 has been cancelled. Refund case #4492 created
4 hours ago
Older notifications
Nick requested your feedback and approval in support request #458
3 days ago
Mike added 1 new file(s) to Product management project
new_contract.pdf
112KB
1 day ago
All hands meeting will take place coming Thursday at 13:45.
2 days ago
Christine commented on your community post from 10.12.2021
2 days ago
HR department requested you to complete internal survey by Friday
3 days ago
Loading...
Demo configuration
Color mode
Direction
Layouts
Purchase Limitless