Badge徽标数
Badge
徽标数
图标右上角的圆形徽标数字。
| 使用import{ Badge }from"antd"; | 
| 文档编辑此页 | 
一般出现在通知图标或头像的右上角,用于显示需要处理的消息条数,通过醒目视觉形式吸引用户处理。
通用属性参考:通用属性
| 参数 | 说明 | 类型 | 默认值 | 版本 | 
|---|---|---|---|---|
| color | 自定义小圆点的颜色 | string | - | |
| count | 展示的数字,大于 overflowCount 时显示为 ${overflowCount}+,为 0 时隐藏 | ReactNode | - | |
| classNames | 语义化结构 class | Record<SemanticDOM, string> | - | 5.7.0 | 
| dot | 不展示数字,只有一个小红点 | boolean | false | |
| offset | 设置状态点的位置偏移 | [number, number] | - | |
| overflowCount | 展示封顶的数字值 | number | 99 | |
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false | |
| size | 在设置了 count的前提下有效,设置小圆点的大小 | default|small | - | - | 
| status | 设置 Badge 为状态点 | success|processing|default|error|warning | - | |
| styles | 语义化结构 style | Record<SemanticDOM, CSSProperties> | - | 5.7.0 | 
| text | 在设置了 status的前提下有效,设置状态点的文本 | ReactNode | - | |
| title | 设置鼠标放在状态点上时显示的文字 | string | - | 
| 参数 | 说明 | 类型 | 默认值 | 版本 | 
|---|---|---|---|---|
| color | 自定义缎带的颜色 | string | - | |
| placement | 缎带的位置, start和end随文字方向(RTL 或 LTR)变动 | start|end | end | |
| text | 缎带中填入的内容 | ReactNode | - | 
| Token 名称 | 描述 | 类型 | 默认值 | 
|---|---|---|---|
| dotSize | 点状徽标尺寸 | number | 6 | 
| indicatorHeight | 徽标高度 | string | number | 20 | 
| indicatorHeightSM | 小号徽标高度 | string | number | 14 | 
| indicatorZIndex | 徽标 z-index | string | number | auto | 
| statusSize | 状态徽标尺寸 | number | 6 | 
| textFontSize | 徽标文本尺寸 | number | 12 | 
| textFontSizeSM | 小号徽标文本尺寸 | number | 12 | 
| textFontWeight | 徽标文本粗细 | string | number | normal |