Should ONLY use tags allowed in whitelist (flag) Should duplicate tags be allowed or not The 'pattern' setting must be set to some character. Use 'mix' as value to allow mixed-content. Validate input by REGEX pattern (can also be applied on the input itself as an attribute) Ex: // Exposes the tag element, its index & data e.detail exposes the typed valueĬlicking a tag. Input event, when a tag is being typed/edited. This method gets called automatically when instansiating TagifyĪ tag has been added but did not pass vaildation.
see source code.)Ĭonverts the input's value into tags. Removes a specific tag (argument is the tag DOM element to be removed. Removes all tags and resets the original input tag's value propertyĪccepts a String (word, single or multiple with a delimiter), an Array of Objects (see above) or Strings Reverts the input element back as it was before Tagify was applied get tags from the server (ajax) and add them: Script (non-jqueryfied) and all the jQuery's wrapper does is allowing to chain the event listeners for ('add', 'remove', 'invalid') $('')Īccessing methods can be done via the. () Ī jQuery wrapper verison is also available, but I advise not using it because it's basically the exact same as the "normal" or add tags with pre-defined propeties Adding tags dynamically var tagify = new Tagify(.) The rest of the files are most likely irrelevant. Output files, which are automatically generated using Gulp, are in: /dist/
Simply run gulp in your terminal, from the project's path ( Gulp should be installed first). Tags can be trimmed via hellip by giving max-width to the tag element in your CSS.Automatically disallow duplicate tags (vis "settings" object).Each tag can have any properties desired (class, data-whatever, readonly.).Supports read-only mode to the whole componenet or per-tag.Tags can be created by Regex delimiter or by pressing the "Enter" key / focusing of the input.Can paste in multiple values: tag 1, tag 2, tag 3.Auto-complete input as-you-type (whitelist first match).Shows suggestions selectbox (flexiable settings & styling).Supports mix content (text and tags together).