# Tag
### Intro
Used to mark keywords and summarize the main content.
### Install
Register component globally via `app.use`, refer to [Component Registration](#/en-US/advanced-usage#zu-jian-zhu-ce) for more registration ways.
```js
import { createApp } from 'vue';
import { Tag } from 'vant';
const app = createApp();
app.use(Tag);
```
## Usage
### Basic Usage
```html
Tag
Tag
Tag
Tag
```
### Plain style
```html
Tag
```
### Round style
```html
Tag
```
### Mark style
```html
Tag
```
### Closeable
```html
Tag
```
```js
import { ref } from 'vue';
export default {
setup() {
const show = ref(true);
const close = () => {
show.value = false;
};
return {
show,
close,
};
},
};
```
### Custom Size
```html
Tag
Tag
Tag
```
### Custom Color
```html
Tag
Tag
Tag
```
## API
### Props
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| type | Type, can be set to `primary` `success` `danger` `warning` | _string_ | `default` |
| size | Size, can be set to `large` `medium` | _string_ | - |
| color | Custom color | _string_ | - |
| show | Whether to show tag | _boolean_ | `true` |
| plain | Whether to be plain style | _boolean_ | `false` |
| round | Whether to be round style | _boolean_ | `false` |
| mark | Whether to be mark style | _boolean_ | `false` |
| text-color | Text color | _string_ | `white` |
| closeable | Whether to be closeable | _boolean_ | `false` |
### Slots
| Name | Description |
| ------- | ------------ |
| default | Default slot |
### Events
| Event | Description | Arguments |
| ----- | ---------------------------------- | ------------------- |
| click | Emitted when component is clicked | _event: MouseEvent_ |
| close | Emitted when close icon is clicked | _event: MouseEvent_ |
### CSS Variables
The component provides the following CSS variables, which can be used to customize styles. Please refer to [ConfigProvider component](#/en-US/config-provider).
| Name | Default Value | Description |
| --- | --- | --- |
| --van-tag-padding | _0 var(--van-padding-base)_ | - |
| --van-tag-text-color | _var(--van-white)_ | - |
| --van-tag-font-size | _var(--van-font-size-sm)_ | - |
| --van-tag-border-radius | _2px_ | - |
| --van-tag-line-height | _16px_ | - |
| --van-tag-medium-padding | _2px 6px_ | - |
| --van-tag-large-padding | _var(--van-padding-base) var(--van-padding-xs)_ | - |
| --van-tag-large-border-radius | _var(--van-border-radius-md)_ | - |
| --van-tag-large-font-size | _var(--van-font-size-md)_ | - |
| --van-tag-round-border-radius | _var(--van-border-radius-max)_ | - |
| --van-tag-danger-color | _var(--van-red)_ | - |
| --van-tag-primary-color | _var(--van-blue)_ | - |
| --van-tag-success-color | _var(--van-green)_ | - |
| --van-tag-warning-color | _var(--van-orange)_ | - |
| --van-tag-default-color | _var(--van-gary-6)_ | - |
| --van-tag-plain-background-color | _var(--van-white)_ | - |