Tag
Display an item's category, attributes, or status as a short label.
Usage guide
#Display categories, filters, or status with short labels. Use Button for actions and Badge for counts.
Selectable tags
Use selectable to allow toggling, as with a filter.
Removable tags
Use removable to remove selected values from a list. Restrict interaction with disabled or readonly.
Examples
#Feature examples
#Choose a feature from 12 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-tag>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Block user interaction and keyboard focus. | |
boolean | false | Display the current value while preventing edits. | |
boolean | false | Show the tag removal button. | |
boolean | false | Use rounded corners. | |
boolean | false | Allow tag selection events. | |
'small' | 'medium' | 'large' | 'medium' | Component size. | |
TagColor | 'gray' | Color applied to the component. Check the type for supported values. | |
boolean | false | Emit only a removal request. After confirmation, call setRemove(true). |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<{ tag: HTMLSyTagElement }> | Emitted when the user selects an item. | |
CustomEvent<{ tag: HTMLSyTagElement; isManualRemove: boolean }> | Emitted when a selected item is removed. |
Methods
| Method | Returns | Description |
|---|---|---|
Promise<void> | Programmatically remove the tag. `isForce=true` bypasses the `manualClose` opt-out so the tag is removed even when manualClose was set (use this from your confirmation handler). |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |