Badge

用于状态、计数或标签的紧凑标签,提供六种变体和四种状态色。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 可用

用法

DefaultSecondaryOutlineGhostDestructive
RecordingTranscribedExportedPausedSyncing
312899+Local onlyInteractive
design roadmap

导入

ts
import {
  SoneBadgeDirective,
  SoneBadgeRemoveDirective,
} from "@surface-one/angular/badge";

API 参考

SoneBadgeDirective指令

选择器
[soneBadge]
输入
名称类型 默认值
variantBadgeVariant"default"
dot

A leading status dot in the badge's colour (the `<span class="badge-dot">` part, drawn for you).

booleanfalse
interactive

The badge reacts to the pointer (hover fill, pointer cursor) like a link or button badge — for a badge whose clickable parent is not itself the badge.

booleanfalse

SoneBadgeRemoveDirective指令

`button[soneBadgeRemove]` — the remove button inside a removable badge (a tag chip). Put the glyph inside (`<sone-icon icon="close" />`) and name it by what it removes: `aria-label="Remove design"`. `type` defaults to `button`.

选择器
button[soneBadgeRemove]