# Tag input

# Demo

<tag-input
  value="Orange, Black"
  id="tag-input"
  placeholder="Add tag"
  :available-tags="[
    { id: 1, value: 'Red' },
    { id: 2, value: 'Orange' },
    { id: 3, value: 'Black' },
    { id: 4, value: 'This is a tag that has length greater than 35'}
  ]"
  hidden-input-name="tags"
/>

# Props

available-tags

Type
Array

Description
An array with available tags ([{ id: 1, value: 'hey' }])
value

Type
Array, String

Description
An array or comma separated string with tags (['hey', 'there'] or hey, there).
src

Type
String

Description
URL that will be used to fetch autocomplete suggestions (such as: /tag/search?q=). A query will be appended to this URL. There is no need to define available-tags when a remote source is defined.
id

Type
String

Description
The id attribute of the input element
placeholder

Type
String

Description
The placeholder attribute of the input element
limit

Type
Number

Default
0

Description
Limit the number of autocomplete suggestions, no limit is applied by default
hidden-input-name

Type
String

Description
Name of a hidden input field that will be populated with tags

# Events

input

Parameters
Tags (Array)

Description
Emitted on user input
error

Parameters
Response (Object)

Description
Emitted when an error occurs while sending a request to the remote source