Tag Field
An input component that allows users to enter, display, and manage multiple tags or keywords dynamically.
Basic
The basic tag field lets you add tags to your content.
Installation
To install, run the following command:
If you hit any issues, make sure you check out the installation guide here for more information.
Composed Components
This tag field integrates with components like:
When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.
The Tag Field comes packed with several components to enhance functionality and provide a seamless experience.
Manual Installation
For manual installation, use:
Make sure you also install the composed components and the required packages for the component to function properly.
Anatomy
Import the components and use them as shown below, adapting the structure to fit each component.
Appearance
Customize the tag field’s appearance using the appearance
prop.
Max Entry
Set a limit on the number of tags that can be added.
Intent
By default, the tag field component uses the primary
intent. But it has a secondary
intent as well.
Shape
Customize the tag field’s shape using the shape
prop.
Controlled
The tag field is controlled by default. This example demonstrates how to access its value.
Disabled
Disable the tag field by using the isDisabled
prop.
Props
Here's the fixed table:
Prop | Type | Default | Description |
---|---|---|---|
label | string | - | The label of the tag field |
description | string | - | The description of the tag field |
placeholder | string | - | The placeholder of the tag field |
max | number | - | The maximum number of tags that can be added |
className | string | - | The class name of the tag field |
name | string | - | The name of the tag field |
list | ListData | - | The list of tags |
onItemInserted | (tag: TagItemProps) => void | - | The callback function when a tag is inserted |
onItemCleared | (tag: TagItemProps) => void | - | The callback function when a tag is cleared |
isDisabled | boolean | - | The disabled state of the tag field |
intent | string | 'primary' | 'primary', 'secondary' |
shape | string | 'square' | 'square', 'circle' |