Skip to content

GhostTagsInput ​

Use GhostTagsInput to enter and remove a small collection of strings. The themed component comes from @ghostvue/themes. Import the headless component from @ghostvue/vue to supply your own styling.

Save project labels ​

Save project labels

Add and remove labels, submit committed tags, and reset the form.

  • frontend

Type urgent, press Enter, then select Save project. new FormData(form).getAll('labels') returns ['frontend', 'urgent']. An unfinished draft stays visible when you leave the field and is excluded from submission. Reset labels clears the draft and requests the initial tags again. An editable required field with zero committed tags blocks native submission even if its draft contains text.

Add several tags ​

Paste skills Headless

Add comma-separated tags to a labelled headless field.

  • Vue

The default commits only with Enter. Configure :delimiters="[',', ';']" to commit with those keys at the end of the entry or split pasted text. Trimmed, case-sensitive duplicates are skipped. Paste adds all new tags in one update. The tag slot can format the displayed string. Keep its contents non-interactive so the built-in remove button handles activation and focus.

Show imported tags ​

Show imported labels

Display submitted tags in a read-only field.

  • frontend
  • triage

Read-only fields keep the text entry focusable and include committed tags in the form. Disabled fields skip focus, editing, and submission. The nearest native disabled fieldset applies the same rules, including the first legend exception.

Keyboard and focus ​

Tab enters the text input. On an empty entry, Backspace or the arrow toward the tags focuses the last remove button. Use Left and Right (reversed in RTL) to move through the buttons and back to the input. On a button, Home goes to the first tag and End returns to the input. Enter, Space, Backspace, or Delete removes the focused tag. Focus goes to the next tag, then the previous tag or the entry when there are no tags left. Tab and Shift+Tab leave the widget. Escape, Up, and Down retain their native behavior.

Forms, labels, and localization ​

  • Pass id, form, input attributes such as placeholder, and aria-* to the native text entry. The form attribute also sets the owner of the hidden inputs. Class and style apply to the root. Give the entry a visible label, for example through GhostField.
  • Use v-model for controlled tags and replace the array when updating it. The component emits one fresh proposal per action. The current parent value determines which tags render and submit. Pass defaultValue to set the captured reset baseline in either mode.
  • Use messages to localize remove-button names, accepted additions, removals, duplicates, and the required validation message. Overrides can change while the field is mounted.
  • Style the root, list, tag, remove, input, and status parts. The root exposes data-disabled, data-readonly, and data-invalid.

API reference ​

PropTypeDefaultDescription
defaultValuereadonly string[]"[]"Initial uncontrolled tags and reset baseline.
delimitersreadonly (',' | ';')[]"[]"Optional typed and pasted separators.
disabledbooleanfalseDisables editing, focus and submission.
invalidbooleanfalseConsumer-owned invalid state.
messagesPartial<GhostTagsInputMessages>—Localized button, announcement and validation text.
modelValuereadonly string[]—Controlled committed tags.
namestring—Repeated native form field name.
readonlybooleanfalsePrevents edits while preserving focus and submission.
requiredbooleanfalseRequires a committed tag while editable.
SlotSlot propsDescription
tagvalue: stringFormats tag text while the component retains its remove control.

@ghostvue/themes adds no props, events, or slots to the headless GhostTagsInput API, which it forwards.

See the approved behavior specification.