GhostTagsInput reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Edit free-form text tags with one keyboard Tab stop and native form submission and reset.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
defaultValue | readonly string[] | "[]" | No | Initial uncontrolled tags and reset baseline. |
delimiters | readonly (',' | ';')[] | "[]" | No | Optional typed and pasted separators. |
disabled | boolean | false | No | Disables editing, focus and submission. |
invalid | boolean | false | No | Consumer-owned invalid state. |
messages | Partial<GhostTagsInputMessages> | — | No | Localized button, announcement and validation text. |
modelValue | readonly string[] | — | No | Controlled committed tags. |
name | string | — | No | Repeated native form field name. |
readonly | boolean | false | No | Prevents edits while preserving focus and submission. |
required | boolean | false | No | Requires a committed tag while editable. |
Emits
None declared.
Models
| Prop | Event | Type | Description |
|---|---|---|---|
modelValue | update:modelValue | readonly string[] | Fresh proposal for the committed tag sequence. |
Slots
| Name | Description |
|---|---|
tag | Formats tag text while the component retains its remove control. |
Slot props: tag
| Name | Type | Description |
|---|---|---|
value | string | Normalized tag string. |
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLInputElement | null | Native text input after mount. |
focus | () => void | Focuses the native entry. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Widget container. |
data-part | list | List of committed tags. |
data-part | tag | A committed tag. |
data-part | remove | Native remove button. |
data-part | input | Native text input. |
data-part | status | Persistent polite status region. |
data-state | disabled | The field is disabled. |
data-state | readonly | The field is read-only. |
data-state | invalid | The consumer marked the field invalid. |
CSS variables
None declared.
Accessibility
Role: textbox. APG pattern: https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex.
Required ARIA attributes: none.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Enter | Commit a nonempty draft or activate a focused remove button. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
Space | Activate a focused remove button. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
Backspace | From an empty draft focus the last remove button, or remove the focused tag. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
Delete | Remove the focused tag. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
ArrowLeft | Move along the tags or back to the entry, reversed in RTL. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
ArrowRight | Move along the tags or back to the entry, reversed in RTL. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
Home | Focus the first remove button from a remove button. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
End | Focus the text entry from a remove button. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
Tab | Enter through the text entry or leave the widget. | TagsInput navigates and removes tags with real focus @cross-browser (@ghostvue/themes) |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Passed | Every declared key maps to a Chromium browser test that CI runs and requires to pass on every commit. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
tags-input/headless-field
Paste skills Headless
Add comma-separated tags to a labelled headless field.
Press Enter, or paste a comma-separated list to add several skills.
- Vue
headless-field.vue
vue
<script setup lang="ts">
import {
GhostField,
GhostFieldControl,
GhostFieldDescription,
GhostFieldLabel,
GhostTagsInput,
} from '@ghostvue/vue'
const initial: readonly string[] = ['Vue']
</script>
<template>
<GhostField>
<GhostFieldLabel>Skills</GhostFieldLabel>
<GhostFieldDescription>
Press Enter, or paste a comma-separated list to add several skills.
</GhostFieldDescription>
<GhostFieldControl v-slot="field">
<GhostTagsInput
v-bind="field"
:default-value="initial"
:delimiters="[',']"
>
<template #tag="{ value }"
><strong>{{ value }}</strong></template
>
</GhostTagsInput>
</GhostFieldControl>
</GhostField>
</template>