KTag
Tag for categorizing or markup.
Install
bash
pnpm add @ikun-ui/tagbash
yarn add @ikun-ui/tagbash
npm install @ikun-ui/tagBasic 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
| Name | Type | Default | Description |
|---|---|---|---|
| type | primary / success / error / warning / info | primary | type of Tag |
| bgColor | string | - | customize background color |
| textColor | string | - | customize text color |
| icon | string | - | The class name of the icon, following the unocss standard |
| border | boolean | false | whether Tag has a border |
| closable | boolean | false | whether Tag can be removed |
| closeIcon | string | i-carbon-close | The class name of the icon, following the unocss standard |
| cls | string | - | Additional class for component |
| attrs | Record<string, string> | {} | Additional attributes |
Tag Events
| Name | Description | Type |
|---|---|---|
| click | triggers when Tag is clicked | (event: CustomEvent) => void |
| close | triggers when Tag is removed | (event: CustomEvent) => void |
Tag Slots
| Name | Description |
|---|---|
| default | Customize default content |