made-vue-chipbox
TypeScript icon, indicating that this package has built-in type declarations

0.1.0-alpha.6 • Public • Published

MADE Vue project banner

MADE Vue - ChipBox

License - MIT Build - GitHub Actions Source - npmjs npm

A Vue 3 chip/tag input component, a UI component for allowing multiple value input.

MADE Vue Chip Box Component

Usage

To customise the chip box layout, you'll want to import the scss styling:

import "made-vue-chipbox/styles.scss";

In your main file, you can import the component:

import { createApp } from "vue";
import App from "./App.vue";

import ChipBox from "made-vue-chipbox";

const app = createApp(App);
...
app.use(ChipBox);
...
app.mount("#app");

You can then reference the chip box layout component in your app:

<template>
  <div>
    <m-chip-box
      :chips="chips"
      :chipExpr="(chip) => chip.content.text"
      @change="onChipsChanged"
    />
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "App",
  data() {
    return {
      chips: [
        {
          content: { text: "United Kingdom" },
        },
      ],
    };
  },
  methods: {
    onChipsChanged(chips: ChipItem[]) {
      this.chips = chips;
    },
  },
});
</script>

Package Sidebar

Install

npm i made-vue-chipbox

Weekly Downloads

1

Version

0.1.0-alpha.6

License

MIT

Unpacked Size

29 kB

Total Files

17

Last publish

Collaborators

  • jamesmcroft