# simple-tags-for-vue

> Attach or detach tags with suggestions. Vue 3. Styled with Tailwind CSS.

Latest version **1.1.9** (published 2024-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-tags-for-vue
pnpm add simple-tags-for-vue
yarn add simple-tags-for-vue
bun add simple-tags-for-vue
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2024-04-01 |
| First published | 2021-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 24.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | BEAUBUS |
| Maintainers | beaubus |
| Keywords | vue, vue.js, vue3, vue 3.0, vuejs, tags, input, tailwind, tailwindcss, Tailwind CSS, laravel, tags input, laravel tags, spatie/laravel-tags |

## Links

- npm: https://www.npmjs.com/package/simple-tags-for-vue
- Repository: https://github.com/beaubus/simple-tags-for-vue
- Homepage: https://github.com/beaubus/simple-tags-for-vue#readme
- Issues: https://github.com/beaubus/simple-tags-for-vue/issues
- npm.io page: https://npm.io/package/simple-tags-for-vue

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.1.9 (latest) — 2024-04-01
- 1.1.8 — 2024-01-05
- 1.1.7 — 2023-12-22
- 1.1.6 — 2023-07-10
- 1.1.5 — 2023-04-09
- 1.1.4 — 2022-05-12
- 1.1.3 — 2022-01-16
- 1.1.2 — 2021-09-20
- 1.1.0 — 2021-09-20
- 1.0.8 — 2021-09-19
- 1.0.7 — 2021-09-19
- 1.0.6 — 2021-02-26
- 1.0.5 — 2021-02-26
- 1.0.4 — 2021-02-26
- 1.0.3 — 2021-02-26
- … 2 more at https://npm.io/package/simple-tags-for-vue/versions

## README

# Simple tags component for Vue.js 3 

<a href="https://www.npmjs.com/package/simple-tags-for-vue">
    <img alt="npm" src="https://img.shields.io/npm/dt/simple-tags-for-vue?logo=npm">
</a>

<a href="https://github.com/beaubus/simple-tags-for-vue/blob/master/LICENSE">
    <img alt="MIT" src="https://img.shields.io/github/license/beaubus/simple-tags-for-vue">
</a>
&nbsp;&nbsp;
<a href="https://twitter.com/intent/follow?screen_name=daily_web_dev">
    <img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/daily_web_dev?style=social">
</a>

<br>
<br>

A package that allows you to attach, detach and remove tags with ease, following provided suggestions. The tags are styled by default using [Tailwind CSS](https://tailwindcss.com/)

![](demo.gif)

<br>

<a target="_blank" href="https://www.beaubus.com/packages/#simple-tags-for-vue">Demo</a>

## Installation

NPM
```bash
npm i simple-tags-for-vue
```

CDN
```bash
<script src="https://www.unpkg.com/simple-tags-for-vue/dist/simple-tags-for-vue.min.js"></script>
```

## Usage
```js
import simple_tags_for_vue from 'simple-tags-for-vue';

// add to the components section
components: {
    'simple-tags-for-vue': simple_tags_for_vue
}
```

```html
<simple-tags-for-vue v-model="selected_tags"
                     :existing="existing_tags"
></simple-tags-for-vue>
```

### Styling
If you have [tailwindcss](https://tailwindcss.com/) installed, you are good to go. If not, just turn it off `:tailwind="false"`, add `class="your-own-class"` and style it as you need.

### Backend
POST query of the form with simple-tags-for-vue results in an array of 'tags'.

If you use Laravel with [spatie/laravel-tags](https://github.com/spatie/laravel-tags):
```php
<?php

// Get tags
$tags = $model->tags->map(fn($tag) => $tag->name);
$existing_tags = Tag::all()->map(fn($tag) => $tag->name);

// Update tags
$tags = $request->input('tags') ?? [];
$model->syncTags($tags);
```

## Properties
| Name            | Type              | Default     | Description                                        |
| ---             | ---               | ---         | ---                                                |
| modelValue      | Array             | []          | Value for v-model                                  |
| existing        | Array             | []          | List of existing tags (used in suggestions)        |
| unused          | Array             | []          | List of unused tags (can be permanently deleted)   |
| tailwind        | Boolean           | true        | Style with tailwindcss                             |


## Emits
| Name               | Description              |
| ---                | ---                      |
| update:modelValue  | Update event for v-model |
| destroy            | Permanently delete tag   |


## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.

---
_Source: https://npm.io/package/simple-tags-for-vue · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
