Tag
标签用于标记和分类,可展示状态、属性或关键词。
使用
ts
import { NxTag, NxTags } from "@pc-nexus/angular";ts
import { NxTag, NxTags } from "@pc-nexus/react";属性
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
color | 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | string | 标签颜色,默认 default | |
appearance | 'fill' | 'outline' | 'subtle' | 标签外观,默认 fill | |
size | 'small' | 'medium' | 'large' | 尺寸,默认 medium | |
shape | 'ellipse' | 'rectangle' | 标签形状,默认 rectangle | |
hoverable | boolean | 是否启用悬停效果,默认 false |
示例
Basic
Color
通过 color 设置语义色或自定义色值。
Appearance
通过 appearance 设置外观,取值可以为 'fill' | 'outline' | 'subtle'。
Shape
通过 shape 设置形状,取值可以为 'ellipse' | 'rectangle'
Size
Hoverable
With icon
标签内容可嵌套 nx-icon 等子节点。
Dynamic
Tags
使用 nx-tags 包裹多个 nx-tag。