Badge / 徽章

显示一个需要注意的指标。

基础的

展示一个数字或一段文字。

类型

以不同的色彩表达不同的状态。

Custom color

了解更多颜色,请参考 色彩章节

锚点

将徽章固定在指定位置。

APIs / 接口文档

Badge.Props

属性描述类型推荐值默认
type徽章的类型BadgeTypesBadgeTypesdefault
dot忽略内容并显示圆点boolean-false
...原生属性HTMLAttributes'alt', 'id', 'className', ...-

Badge.Anchor.Props

属性描述类型推荐值默认
placement固定徽章的位置AnchorPlacementAnchorPlacementtopRight
...原生属性HTMLAttributes'alt', 'id', 'className', ...-

BadgeTypes

type BadgeTypes = 'default' | 'secondary' | 'success' | 'warning' | 'error'

AnchorPlacement

type AnchorPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight'