When to use
It can be used to tag by dimension or property.
When categorizing.
Usage of basic Tag, and it could be closable by set closable property. Closable Tag supports onClose events.
We preset a series of colorful tag styles for use in different situations. You can also set it to a hex color string for custom color.
Generating a set of Tags by array, you can add and remove dynamically.
CheckableTag works like Checkbox, click it to toggle checked state.
it is an absolute controlled component and has no uncontrolled mode.
By using the visible prop, you can control the close state of Tag.
We preset five different colors, you can set color property such as success, processing, error, default and warning to indicate specific status.
API
Tag
| Property | Description | Type | Default |
|---|
closable | Whether the Tag can be closed | boolean | false |
color | Color of the Tag | string | - |
closeIcon | custom close icon | ReactNode | - |
onClose | Callback executed when tag is closed | (e) => void | - |
visible | Whether the Tag is closed or not | boolean | true |
icon | Set the icon of tag | ReactNode | - |
Tag.CheckableTag
| Property | Description | Type | Default |
|---|
checked | Checked status of Tag | boolean | false |
onChange | Callback executed when Tag is checked/unchecked | (checked) => void | - |