All Projects → prabhuignoto → smart-tagz

prabhuignoto / smart-tagz

Licence: MIT License
🏷Smart input tags for Vue

Programming Languages

Vue
7211 projects
typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to smart-tagz

vue-word-highlighter
The word highlighter library for Vue 2 and Vue 3.
Stars: ✭ 112 (+300%)
Mutual labels:  vue-components, vue3
vitepress-for-component
📖 针对组件开发的VitePress。
Stars: ✭ 142 (+407.14%)
Mutual labels:  vue-components, vue3
Different-UI
✨ A Vue.js 3 UI Library — a Toy
Stars: ✭ 62 (+121.43%)
Mutual labels:  vue-components, vue3
vue-virtualised
Blazing fast scrolling and updating for any amount of list and hierarchical data.
Stars: ✭ 18 (-35.71%)
Mutual labels:  vue-components, vue3
vuestic-ui
Free and Open Source UI Library for Vue 3 🤘
Stars: ✭ 1,501 (+5260.71%)
Mutual labels:  vue-components, vue3
vue-load-image
A Vue component for showing loader during image loading https://john015.github.io/vue-load-image/
Stars: ✭ 60 (+114.29%)
Mutual labels:  vue-components, vue3
vue3-docs
vue中文社区,vue3 中文文档
Stars: ✭ 180 (+542.86%)
Mutual labels:  vue-components, vue3
Nutui
京东风格的移动端 Vue2、Vue3 组件库 (A Vue.js UI Toolkit for Mobile Web)
Stars: ✭ 3,870 (+13721.43%)
Mutual labels:  vue-components, vue3
v-intl
Add i18n to your awesome Vue 3 app 🔉
Stars: ✭ 13 (-53.57%)
Mutual labels:  vue-components, vue3
bootstrap5-tags
Replace select[multiple] with nices badges for Bootstrap 5
Stars: ✭ 58 (+107.14%)
Mutual labels:  tags, tagsinput
Vue Tags Input
A tags input component for VueJS
Stars: ✭ 761 (+2617.86%)
Mutual labels:  tags, vue-components
hoc-element-table
📦 A Vue 3.x Table Component built on Webpack 5
Stars: ✭ 26 (-7.14%)
Mutual labels:  vue-components, vue3
Vue Gl
Vue.js components rendering 3D WebGL graphics reactively with three.js
Stars: ✭ 434 (+1450%)
Mutual labels:  tags, vue-components
chusho
A library of bare & accessible components and tools for Vue.js 3
Stars: ✭ 47 (+67.86%)
Mutual labels:  vue-components, vue3
Vue3 News
🔥 Find the latest breaking Vue3、Vue CLI 3+ & Vite News. (2021)
Stars: ✭ 2,416 (+8528.57%)
Mutual labels:  vue-components, vue3
vue-cirrus
Vue components for the Cirrus CSS framework.
Stars: ✭ 43 (+53.57%)
Mutual labels:  vue-components, vue3
vui-vc-next
Vue 3 with Vite Playground - Mobile web UI components - (vue3+vite2).
Stars: ✭ 15 (-46.43%)
Mutual labels:  vue-components, vue3
codemirror-editor-vue3
CodeMirror component for Vue3
Stars: ✭ 22 (-21.43%)
Mutual labels:  vue-components, vue3
fect
Minimalist UI components built on Vue-next
Stars: ✭ 352 (+1157.14%)
Mutual labels:  vue-components, vue3
vue2-timeago
🙌 A vue component used to format date with time ago statement. 💬
Stars: ✭ 76 (+171.43%)
Mutual labels:  vue-components, vue3

Build Status Codacy Badge DeepScan grade Language grade: JavaScript Snyk Vulnerabilities for GitHub Repo Depfu

Edit smart-tagz

Features

  • Autosuggest with support for keyboard selection.
  • ✏️ Edit the tags inline by double clicking them.
  • 🏷️ Paste strings with delimiters of your choice and the component will create the tags for you.
  • 🗑️ Quickly delete the tags with a visual confirmation before removing a tag.
  • 🧹 Quickly clear all tags with quick-delete mode.
  • 🔒  Lock the component using the readonly mode.
  •  Restrict the number of tags and Handle duplicates gracefully.
  • 🌈 Customize the colors.

Table of Contents

Installation

yarn install smart-tagz

🚀 Getting Started

smart-tagz has some great defaults to get you started quickly. Please check the props list for all options.

<template>
  <smart-tagz
    autosuggest
    editable
    inputPlaceholder="Select Countries ..."
    :sources="sources"
    :allowPaste="{delimiter: ','}"
    :allowDuplicates="false"
    :maxTags="20"
    :defaultTags="['United Kingdom', 'Uruguay', 'Uzbekistan']"
  />
</template>

<script>
import { SmartTagz } from "smart-tagz";
import "smart-tagz/dist/smart-tagz.css";

import { defineComponent } from "vue";

export default defineComponent({
  name: "Basic",
  components: {
    SmartTagz,
  }
});
</script>

🍬 Demos

Head to our demo page for examples showcasing all the features.

https://smart-tagz.vercel.app/

Props

Prop Type Description Default
defaultTags Array initialize with a default set of tags []
width String width of the container 100%
autosuggest Boolean Enables the autosuggest feature. you also need to set the sources for the autosuggest to work. false
sources Array Works as the datasource for the autosuggest feature []
allowPaste { delimiter: String } Parses the pasted string based on the passed delimiter and creates tags automatically {delimiter: ","}
editable Boolean makes the tags editable false
allowDuplicates Boolean allows/disallows duplicate tag entries while pasted or entered manually. true
maxTags Number sets the Maximum number of tags 10
inputPlaceholder String Placeholder for the input box. "Enter tag..."
readOnly Boolean Makes the whole component readOnly. ideal for display only purposes. false
quick-delete Boolean When enabled all the tags can be cleared by CTRL + A, DEL false
on-changed Function callback that gets called when a new tag is added or an existing tag is deleted false

Default Tags

We can initialize smart-tagz with some default tags. This setting will mostly be used along with the readonly prop to create tags for display only purposes.

<smart-tagz :default-tags="['United Kingdom', 'Uruguay', 'Uzbekistan']" />

Duplicates

You can decide how to manage duplicate tags by either allowing or disallowing them completely. When set to false no duplicate values are allowed.

<smart-tagz :allow-duplicates="false" />

Auto Suggest

Whe set to true, the autosuggest prop suggests values in a dropdown. You also need to set the sources prop for this to work. The sources prop can be an Array of strings.

 <smart-tagz autosuggest :sources="['India', 'Brazil', 'China', 'United Kingdom']" />

Max Tags

The component can also be configured to accept the Maximum number of tags that can be created. Once the threshold is reached, the input will be hidden from the user.

Here we restrict the tags to 3

<smart-tagz :max-tags="3" />

Paste

The component can parse strings and automatically create tags for you. The default delimiter is "," but you can override this setting by manually setting the delimiter option.

<smart-tagz :allow-paste="{delimiter: ';'}" />

Editable Tags

The Tags are not editable by default, but you can change this setting with the editable prop. Simply double click a tag, make the changes and hit enter to save.

<smart-tagz editable />

Readonly Tags

You can lock the component with readonly mode. All interactions are disabled in read-only mode.

<smart-tagz read-only />

Theme

The components color scheme can be customized by passing a custom theme prop.

  <smart-tagz
    :theme="{
      primary: '#545454',
      background: '#bdbdbd',
      tagTextColor: '#fff',
    }"
  />

📦 Build Setup

# install dependencies
yarn install

# start dev
yarn run dev

# package lib
npm run rollup

# run css linting
yarn run lint:css

🔨 Contributing

  1. Fork it ( https://github.com/prabhuignoto/smart-tagz/fork )
  2. Create your feature branch (git checkout -b new-feature)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin new-feature)
  5. Create a new Pull Request

Notes

The project uses vite instead of @vue/cli. I choose vite for speed and i also believe vite will be the future.

Meta

Prabhu Murthy – @prabhumurthy2[email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/prabhuingoto/

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].