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.

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>

Props

NameDescriptionTypeRequiredDefault
styleStyle attribut of the component root elementNative typeNoundefined
classClass attribut of the component root elementNative typeNoundefined
model-valuev-model
TSParenthesizedType[]Noundefined
placeholderThe placeholder of the inputstringNoundefined
labelThe label of the inputstringNoundefined
disabledDisable the inputbooleanNofalse
errorDisplay the input with error stylebooleanNofalse
successDisplay the input with success stylebooleanNofalse
warningDisplay the input with warning stylebooleanNofalse
sizeThe size of the inputMazSizeNo'md'
colorThe color of the inputMazColorNo'primary'
blockThe input will be displayed in full widthbooleanNoundefined
add-tags-on-blurAdd tags on blurbooleanNotrue
hintThe hint text to display below the input.stringNoundefined

Events

Event namePropertiesDescription
update:model-value