Skip to content

Tag ​

When To Use ​

  • It can be used to tag by dimension or property.
  • When categorizing.

Demo ​

Basic Usage ​

API ​

Properties ​

PropertyAttributeDescriptionTypeDefault
colorcolorLabel color theme provides 10 preset color schemes to meet the visual needs of different scenarios:
1. blue: blue theme (neutral information)
2. error: error red (failed operation/dangerous state)
3. gray: gray theme (default neutral color)
4. green: green theme (success/completion state)
5. info: information blue (notification/prompt information)
6. primary: brand primary color (important content)
7. red: warning red (urgent notification)
8. success: success green (successful operation)
9. warning: warning yellow (attention/reminder)
10. yellow: emphasis yellow (highlighted display)
"blue" | "error" | "gray" | "green" | "info" | "primary" | "red" | "success" | "warning" | "yellow"'gray'
dismissibledismissibleWhether to display the close button. When set to true, a close icon is displayed on the right side of the tag. Clicking it triggers the zane-tag--dismiss event.booleanfalse
imageSrcimage-srcLabel image address After setting, the specified image (such as user avatar) is displayed on the left side of the labelstringundefined
selectedselectedSelected state Indicates whether the tag is selected, often used in multiple selection scenariosbooleanfalse
sizesizeLabel size Controls the overall size of the label:
1. md: medium size (default)
2. sm: small size (compact layout)
"md" | "sm"'md'
valuevalueTag value The business data value associated with the tag, which is passed as a parameter when the event is triggeredstring''

Events ​

EventDescriptionType
zane-tag--clickTab click event is triggered when the tab is clicked (excluding the close button area)CustomEvent<any>
zane-tag--dismissThe tag close event is triggered when the close button is clicked, passing the value or text content of the tagCustomEvent<any>

Dependencies ​

Used by ​

Depends on ​

Released under the MIT License.