Skip to content

KTag ​

Tag for categorizing or markup.

Install ​

bash
pnpm add @ikun-ui/tag
bash
yarn add @ikun-ui/tag
bash
npm install @ikun-ui/tag

Basic usage ​

Use the type attribute to define Tag's type. In addition, the bgColor and textColor attribute can be used to set the background and text color of the Tag.

Removable Tag ​

closable attribute can be used to define a removable tag. close event triggers when Tag is removed. In addition, the closeIcon attribute can customize the close icon.

Icon Tag ​

icon attribute can be used to define a tag with an icon.

Tag Props ​

NameTypeDefaultDescription
typeprimary / success / error / warning / infoprimarytype of Tag
bgColorstring-customize background color
textColorstring-customize text color
iconstring-The class name of the icon, following the unocss standard
borderbooleanfalsewhether Tag has a border
closablebooleanfalsewhether Tag can be removed
closeIconstringi-carbon-closeThe class name of the icon, following the unocss standard
clsstring-Additional class for component
attrsRecord<string, string>{}Additional attributes

Tag Events ​

NameDescriptionType
clicktriggers when Tag is clicked(event: CustomEvent) => void
closetriggers when Tag is removed(event: CustomEvent) => void

Tag Slots ​

NameDescription
defaultCustomize default content

MIT Licensed