Skip to content

Badge 徽标

状态点徽标。6×6 圆点,12 色 + disabled 态。

v1 实现范围

  • Badge (dot-only) — 12 色 variant + disabled
  • Badge-Count (number / text pill, 16 高,hug content) · v1.1

色板

theme美餐绿,用于普通强调
warning橙黄,注意类
error红,通知 / 错误(默认)
apricot杏色,柔和提示
orange
green功能绿(非品牌)
teal
blue
indigo靛蓝
purple
magenta品红
white中性白
disabled通用置灰态(color 任意)

用法

vue
<Badge color="error" />          <!-- 默认红色,最常见 -->
<Badge color="theme" />          <!-- 美餐绿 -->
<Badge color="warning" />        <!-- 橙黄 -->
<Badge color="white" />          <!-- 中性白 -->
<Badge color="error" disabled /> <!-- 置灰 -->

通常贴在父元素的右上角(绝对定位):

vue
<div style="position: relative; display: inline-block">
  <Button type="trans" icon-only icon="general/notification" />
  <Badge color="error" style="position: absolute; top: 2px; right: 2px" />
</div>

Props

Prop类型默认说明
color'theme' | 'warning' | 'error' | 'apricot' | 'orange' | 'green' | 'teal' | 'blue' | 'indigo' | 'purple' | 'magenta' | 'white''error'圆点颜色,对应 --mc-<hue>-2 token
disabledbooleanfalse置灰态,覆盖 color,颜色变为 --mc-n-1