Skip to main content
Version: v1 (Current)

Tags Input

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

TagsInput​

import { TagsInput } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValueAcceptableInputValue[] | null | undefined—The controlled value of the tags input. Can be bind as v-model.
defaultValueAcceptableInputValue[] | undefined—The value of the tags that should be added. Use when you do not need to control the state of the tags input
addOnPasteboolean | undefined—When true, allow adding tags on paste. Work in conjunction with delimiter prop.
addOnTabboolean | undefined—When true allow adding tags on tab keydown
addOnBlurboolean | undefined—When true allow adding tags blur input
duplicateboolean | undefined—When true, allow duplicated tags.
disabledboolean | undefined—When true, prevents the user from interacting with the tags input.
delimiterstring | RegExp | undefined—The character or regular expression to trigger the addition of a new tag. Also used to split tags for @paste event
dirDirection | undefined—The reading direction of the combobox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
maxnumber | undefined—Maximum number of tags.
idstring | undefined——
convertValue((value: string) => AcceptableInputValue) | undefined—Convert the input value to the desired type. Mandatory when using objects as values and using TagsInputInput
displayValue((value: AcceptableInputValue) => string) | undefined—Display the value of the tag. Useful when you want to apply modifications to the value like adding a suffix or when using object as values
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
namestring | undefined—The name of the field. Submitted with its owning form as part of a name/value pair.
requiredboolean | undefined—When true, indicates that the user must set the value before the owning form can be submitted.

Events​

NameTypeRequired / defaultDescription
update:modelValue[payload: AcceptableInputValue[]]——
invalid[payload: AcceptableInputValue]——
addTag[payload: AcceptableInputValue]——
removeTag[payload: AcceptableInputValue]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Apple', 'Banana'])
return { tags }
},
template: `
<TagsInput v-model="tags" class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add a fruit..." />
</TagsInput>
`,
}),
}

WithMax​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
name: 'With Max',
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Vue', 'Laravel'])
return { tags }
},
template: `
<div class="grid w-full max-w-sm gap-1.5">
<TagsInput v-model="tags" :max="3">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add up to 3 tags..." />
</TagsInput>
<p class="text-sm text-muted-foreground">{{ tags.length }}/3 tags</p>
</div>
`,
}),
}

Disabled​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Read-only', 'Locked'])
return { tags }
},
template: `
<TagsInput v-model="tags" disabled class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Disabled..." />
</TagsInput>
`,
}),
}

TagsInputInput​

import { TagsInputInput } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
placeholderstring | undefined—The placeholder character to use for empty tags input.
autoFocusboolean | undefined—Focus on element when mounted.
maxLengthnumber | undefined—Maximum number of character allowed.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Apple', 'Banana'])
return { tags }
},
template: `
<TagsInput v-model="tags" class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add a fruit..." />
</TagsInput>
`,
}),
}

WithMax​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
name: 'With Max',
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Vue', 'Laravel'])
return { tags }
},
template: `
<div class="grid w-full max-w-sm gap-1.5">
<TagsInput v-model="tags" :max="3">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add up to 3 tags..." />
</TagsInput>
<p class="text-sm text-muted-foreground">{{ tags.length }}/3 tags</p>
</div>
`,
}),
}

Disabled​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Read-only', 'Locked'])
return { tags }
},
template: `
<TagsInput v-model="tags" disabled class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Disabled..." />
</TagsInput>
`,
}),
}

TagsInputItem​

import { TagsInputItem } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
valueAcceptableInputValueRequiredValue associated with the tags
disabledboolean | undefined—When true, prevents the user from interacting with the tags input.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Apple', 'Banana'])
return { tags }
},
template: `
<TagsInput v-model="tags" class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add a fruit..." />
</TagsInput>
`,
}),
}

WithMax​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
name: 'With Max',
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Vue', 'Laravel'])
return { tags }
},
template: `
<div class="grid w-full max-w-sm gap-1.5">
<TagsInput v-model="tags" :max="3">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add up to 3 tags..." />
</TagsInput>
<p class="text-sm text-muted-foreground">{{ tags.length }}/3 tags</p>
</div>
`,
}),
}

Disabled​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Read-only', 'Locked'])
return { tags }
},
template: `
<TagsInput v-model="tags" disabled class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Disabled..." />
</TagsInput>
`,
}),
}

TagsInputItemDelete​

import { TagsInputItemDelete } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Apple', 'Banana'])
return { tags }
},
template: `
<TagsInput v-model="tags" class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add a fruit..." />
</TagsInput>
`,
}),
}

WithMax​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
name: 'With Max',
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Vue', 'Laravel'])
return { tags }
},
template: `
<div class="grid w-full max-w-sm gap-1.5">
<TagsInput v-model="tags" :max="3">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add up to 3 tags..." />
</TagsInput>
<p class="text-sm text-muted-foreground">{{ tags.length }}/3 tags</p>
</div>
`,
}),
}

Disabled​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Read-only', 'Locked'])
return { tags }
},
template: `
<TagsInput v-model="tags" disabled class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Disabled..." />
</TagsInput>
`,
}),
}

TagsInputItemText​

import { TagsInputItemText } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Apple', 'Banana'])
return { tags }
},
template: `
<TagsInput v-model="tags" class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add a fruit..." />
</TagsInput>
`,
}),
}

WithMax​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
name: 'With Max',
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Vue', 'Laravel'])
return { tags }
},
template: `
<div class="grid w-full max-w-sm gap-1.5">
<TagsInput v-model="tags" :max="3">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add up to 3 tags..." />
</TagsInput>
<p class="text-sm text-muted-foreground">{{ tags.length }}/3 tags</p>
</div>
`,
}),
}

Disabled​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
TagsInput,
TagsInputInput,
TagsInputItem,
TagsInputItemDelete,
TagsInputItemText,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { TagsInput, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText },
setup() {
const tags = ref(['Read-only', 'Locked'])
return { tags }
},
template: `
<TagsInput v-model="tags" disabled class="w-full max-w-sm">
<TagsInputItem v-for="tag in tags" :key="tag" :value="tag">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Disabled..." />
</TagsInput>
`,
}),
}