Skip to content

MazInputTags ​

MazInputTags is a standalone component like free inputs to help user select many values and return an Array of strings. Color options are also available.

Before use it, you should install the MazUi plugin in your project, follow instructions in Getting Started

Basic usage ​

Returned value

tags: [ "tags 1", "tags 2" ]
vue
<script lang="ts" setup>
import MazInputTags from 'maz-ui/components/MazInputTags'
import { ref } from 'vue'

const tags = ref(['tags 1', 'tags 2'])
const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
</script>

<template>
  <MazInputTags
    v-model="tags"
    label="Enter tags"
    color="info"
  />
</template>

Sizing ​

vue
<script lang="ts" setup>
import MazInputTags from 'maz-ui/components/MazInputTags'
import { ref } from 'vue'

const tags = ref(['tags 1', 'tags 2'])
const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
</script>

<template>
  <div class="maz:flex maz:flex-col maz:gap-2">
    <MazInputTags
      v-for="size in sizes"
      :key="size"
      v-model="tags"
      :size="size"
      placeholder="Enter tags"
      color="secondary"
    />
  </div>
</template>
vue
<script lang="ts" setup>
import MazInputTags from 'maz-ui/components/MazInputTags'
import { ref } from 'vue'

const tags = ref(['tags 1', 'tags 2'])
const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
</script>

<template>
  <MazInputTags
    v-model="tags"
    label="Enter tags"
    color="info"
  />

  <MazInputTags
    v-model="tags"
    placeholder="Enter tags"
    color="secondary"
    size="sm"
  />
</template>

Tips ​

TIP

This component use MazInput, so it inherits all his props

Props ​

NameDescriptionTypeRequired
styleStyle attribut of the component root elementNative typeNo
classClass attribut of the component root elementNative typeNo
model-valuev-model
TSParenthesizedType[]No
placeholderThe placeholder of the inputstringNo
labelThe label of the inputstringNo
disabledDisable the inputbooleanNo
errorDisplay the input with error stylebooleanNo
successDisplay the input with success stylebooleanNo
warningDisplay the input with warning stylebooleanNo
sizeThe size of the inputMazSizeNo
colorThe color of the inputMazColorNo
blockThe input will be displayed in full widthbooleanNo
add-tags-on-blurAdd tags on blurbooleanNo
hintThe hint text to display below the input.stringNo

Events ​

Event namePropertiesDescription
update:model-value