Ship faster with goilerplate templUI Pro

Tags Input

Tags input field that allows users to enter and edit tags.

Source Tailwind CSS JavaScript

127.0.0.1/32

Installation

templui add tagsinput

Load the script once in your layout:

<head>
  @tagsinput.Script()
</head>

Examples

Suggestions

Linux
Windows
macOS
Ubuntu
Debian
Fedora
Arch Linux
CentOS
FreeBSD

Disabled

127.0.0.1/32

With Label

127.0.0.1/32

Form

Enter a network in format like '1.1.1.1/32'

Please enter a valid network in format like '1.1.1.1/32'

API Reference

Required parameter
Hover for description

TagsInput

Interactive input component for managing a collection of tags.

Name Type Default
ID

Unique identifier for the tags input container.

string
-
Name

Name attribute for the hidden input fields used in form submission.

string
-
Value

Array of current tag values.

[]string
[]
Placeholder

Placeholder text for the input field.

string
-
Class

Additional CSS classes to apply to the tags input container.

string
-
HasError

Whether to display error styling on the input.

bool
false
Attributes

Additional HTML attributes to apply to the container element.

templ.Attributes
-
Disabled

Whether the input is disabled and non-interactive.

bool
false
Readonly

Whether the input is read-only (tags can be removed but not added).

bool
false
Suggestions

List of suggestions shown as autocomplete options while typing.

[]string
[]