All Projects → RyanFitzgerald → tagselector

RyanFitzgerald / tagselector

Licence: MIT license
Dependency-free JS library that turns select fields in customizable tag clouds

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to tagselector

React Native Dropdown Picker
A single / multiple, categorizable & searchable item picker (dropdown) component for react native which supports both Android & iOS.
Stars: ✭ 230 (+1110.53%)
Mutual labels:  select, dropdown, multiple
Nb Choices
Angular wrapper for choices.js, vanilla, lightweight, configurable select box/text input plugin
Stars: ✭ 32 (+68.42%)
Mutual labels:  select, tags, dropdown
Angular Chosen
AngularJS Chosen directive is an AngularJS Directive that brings the Chosen jQuery in a AngularJS way
Stars: ✭ 695 (+3557.89%)
Mutual labels:  select, dropdown, multiple
vue-tags-component
Vue.js 2+ tags component
Stars: ✭ 27 (+42.11%)
Mutual labels:  select, tags, dropdown
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+6573.68%)
Mutual labels:  select, dropdown
React Native Picker Select
🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
Stars: ✭ 1,229 (+6368.42%)
Mutual labels:  select, dropdown
Multiselect
Vue 3 multiselect component with single select, multiselect and tagging options.
Stars: ✭ 92 (+384.21%)
Mutual labels:  select, dropdown
Bootstrap Select
🚀 The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more.
Stars: ✭ 9,442 (+49594.74%)
Mutual labels:  select, dropdown
React Native Modal Dropdown
A react-native dropdown/picker/selector component for both Android & iOS.
Stars: ✭ 1,103 (+5705.26%)
Mutual labels:  select, dropdown
Pretty Dropdowns
A simple, lightweight jQuery plugin to create stylized drop-down menus.
Stars: ✭ 96 (+405.26%)
Mutual labels:  select, dropdown
Ng Select
⭐ Native angular select component
Stars: ✭ 2,781 (+14536.84%)
Mutual labels:  select, dropdown
Angular2 Multiselect Dropdown
Angular 2 Dropdown Multiselect
Stars: ✭ 225 (+1084.21%)
Mutual labels:  select, dropdown
React Native Selectmultiple Button
A button (or a grouped buttons) supporting multiple or radio selection by building with React Native. https://github.com/danceyoung/selectmultiplebuttons for Swift.
Stars: ✭ 72 (+278.95%)
Mutual labels:  select, multiple
Ngx Select Dropdown
Custom Dropdown for Angular 4+ with multiple and single selection options
Stars: ✭ 91 (+378.95%)
Mutual labels:  select, dropdown
Ember Select Box
🔠 A faux select box for Ember apps
Stars: ✭ 60 (+215.79%)
Mutual labels:  select, dropdown
React Responsive Select
A customisable, touchable, React select / multi-select form control. Built with keyboard and screen reader accessibility in mind
Stars: ✭ 98 (+415.79%)
Mutual labels:  select, dropdown
Flutter smart select
SmartSelect allows you to easily convert your usual form select or dropdown into dynamic page, popup dialog, or sliding bottom sheet with various choices input such as radio, checkbox, switch, chips, or even custom input. Supports single and multiple choice.
Stars: ✭ 179 (+842.11%)
Mutual labels:  select, dropdown
Vanilla Select
Standalone replacement for select boxes.
Stars: ✭ 12 (-36.84%)
Mutual labels:  select, dropdown
React Select Me
Fast 🐆. Lightweight 🐜. Configurable 🐙. Easy to use 🦄. Give it a shot 👉🏼
Stars: ✭ 119 (+526.32%)
Mutual labels:  select, dropdown
Vue Treeselect
A multi-select component with nested options support for Vue.js
Stars: ✭ 2,347 (+12252.63%)
Mutual labels:  select, dropdown

Tag Selector

Lightweight (~2kb gzipped), ES6 Class-based library for turning select fields into customizable and user friendly tag clouds.

Features include:

  • ES6 Class-based (Transpiled to ES5 / CommonJS)
  • ~2kb in size gzipped
  • 100% Dependency free
  • Comes completely unstyled or with an optional base theme (see screenshot)
  • Easy to style with well-named CSS classes
  • Mobile Friendly

Tag selector demo

See demo here

This library works by simply hiding and changing the hidden select field behind the scenes as user selects tags. The way you handle forms with selects remains the same, however users get a much more user friendly experience.

Installation

Via NPM:

npm install --save tagselector

Or simply download dist/tagselector.js manually if not using NPM.

Then simply include it however you like:

const TagSelector = require('tagselector');

or

<script src="path/to/tagselector.js"></script>

Usage

To use, simply create a select field with a unique ID, as well as some options with text and values:

<select id="someSelect">
  <option value="orange">Orange</option>
  <option value="apple">Apple</option>
</select>

Note: Add multiple to the select in order to get multiselect functionality with the tag cloud.

Next, create a new instance of tagselector and pass in the Javascript Object reference:

var selectField = document.getElementById('someSelect');
var tagSelector = new TagSelector(selectField);

To reload a current instance, simply do the following:

var selectField = document.getElementById('someSelect');
var tagSelector = new TagSelector(selectField);
tagSelector.reload();

You can also destroy the instance as follows:

var selectField = document.getElementById('someSelect');
var tagSelector = new TagSelector(selectField);
tagSelector.destroy();

Customization

Tag selector comes with a number of customizations that can be passed as an optional parameter:

var selectField = document.getElementById('someSelect');
var tagSelector = new TagSelector(selectField, {
  max: 2,
  onInit: function() {
    console.log('inited!')
  },
  onDestroy: function() {
    console.log('destroyed!')
  },
  onSelect: function(value, text) {
    console.log(`Selected item with value: '${value}' and text: '${text}'`)
  },
  onDeselect: function(value, text) {
    console.log(`Deselected item with value: '${value}' and text: '${text}'`)
  }
});
Setting Description Default
max Sets a maximum number of selects at a given time (only works with multiselect) false
onInit Callback function after new instance of tag selector is created false
onDestroy Callback function after instance of tag selector is destroyed false
onSelect Callback function after a new tag is selected. Params received are option value and text false
onDeselect Callback function after a tag is deselected. Params received are option value and text false

Styles

By default, the wrapper and tags don't come with any styling, leaving the look and feel completely up to you. The classes available to style are as follows:

Class Name Description
.tagselector-wrap The wrapper div surrounding all tags
.tagselector-tag Each individiual tag span
.active Class applied to any actively selected tag

If you would also like some basic styling out of the box (like in the screenshot above), include the CSS: dist/tagselector.css.

License

MIT License. See LICENSE.MD

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].