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.

INFO

Before you have to import the global css files in your project, follow instructions in Getting Started

TIP

This component use MazInput, so it inherits all his props

Basic usage

Value returned

tags: [ "tags 1", "tags 2" ]
vue
<template>
  <MazInputTags
    v-model="tags"
    label="Enter tags"
    color="info"
  />
</template>


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

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

Sizing

vue
<template>
  <div class="maz-flex maz-flex-col maz-gap-2">
    <MazInputTags
      v-for="size in sizes"
      :key="size"
      :size="size"
      v-model="tags"
      placeholder="Enter tags"
      color="secondary"
      size="sm"
    />
  </div>
</template>


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

  const tags = ref(['tags 1', 'tags 2'])
  const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
</script>
vue
<template>
  <MazInputTags
    v-model="tags"
    label="Enter tags"
    color="info"
  />

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


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

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

Props & Event

Props

Prop nameDescriptionTypeValuesDefault
styleStyle attribut of the component root elementTSIndexedAccessType-undefined
classClass attribut of the component root elementTSIndexedAccessType-undefined
modelValue
@model The modelValue of the input
union-undefined
placeholderThe placeholder of the inputstring-undefined
labelThe label of the inputstring-undefined
disabledDisable the inputboolean-false
errorDisplay the input with error styleboolean-false
successDisplay the input with success styleboolean-false
warningDisplay the input with warning styleboolean-false
sizeThe size of the inputSize-'md'
colorThe color of the inputColor-'primary'
blockThe input will be displayed in full widthboolean-

Events

Event namePropertiesDescription
update:model-value