Skip to content

Tag Component

Tag Component

Tags are used for marking, categorizing, and selecting, making it easy for users to quickly identify different types of information.

Basic Usage

Tags have multiple types: default, primary, success, info, warning, and danger.

Show CodeArrow
CopyGitHub

Different Sizes

Tags provide three sizes: small, default, and large.

Show CodeArrow
CopyGitHub

Closable Tags

Setting the closable attribute allows the tag to display a close button. Clicking the close button will trigger the close event.

Show CodeArrow
CopyGitHub

Round Tags

Setting the round attribute makes the tag have rounded corners.

Show CodeArrow
CopyGitHub

Disabled State

Setting the disabled attribute disables tag interaction functionality.

Show CodeArrow
CopyGitHub

Tag API

Attributes

AttributeDescriptionTypeAccepted ValuesDefault
typeTag typestringdefault / primary / success / info / warning / dangerdefault
sizeTag sizestringsmall / default / largedefault
closableWhether closableboolean-false
roundWhether roundedboolean-false
disabledWhether disabledboolean-false

Events

Event NameDescriptionParameters
closeTriggered when closing tag(event: MouseEvent)
clickTriggered when clicking tag(event: MouseEvent)

Slots

Slot NameDescription
defaultTag content

Style Variables

The tag component uses the following style variables, which can be customized through SCSS variables:

Variable NameDescription
$theme-color-primaryTheme color - Primary
$theme-color-successTheme color - Success
$theme-color-infoTheme color - Info
$theme-color-warningTheme color - Warning
$theme-color-dangerTheme color - Danger
$color-whiteWhite color
$text-color-defaultDefault text color
$bg-color-defaultDefault background color
$opacity-disabledDisabled state opacity
$font-size-smallSmall font size
$font-size-defaultDefault font size
$font-size-largeLarge font size

Released under the MIT License