Badge
ステータス、件数、タグのためのコンパクトなラベル。6 つのバリアントと 4 つのステータス色があります。
対応フレームワーク
Angular: 対応 Vue: 対応 React: 対応 React Native: 対応
使い方
DefaultSecondaryOutlineGhostDestructive
RecordingTranscribedExportedPausedSyncing
312899+Local onlyInteractive
design roadmap
<div class="demo-stack">
<div class="demo-row" style="align-items: center">
<span soneBadge>Default</span>
<span soneBadge variant="secondary">Secondary</span>
<span soneBadge variant="outline">Outline</span>
<span soneBadge variant="ghost">Ghost</span>
<span soneBadge variant="destructive">Destructive</span>
</div>
<div class="demo-row" style="align-items: center">
<span soneBadge variant="live" dot>Recording</span>
<span soneBadge variant="accent" dot>Transcribed</span>
<span soneBadge variant="success" dot>Exported</span>
<span soneBadge variant="warning" dot>Paused</span>
<span soneBadge variant="info" dot>Syncing</span>
</div>
<div class="demo-row" style="align-items: center">
<span soneBadge variant="count">3</span>
<span soneBadge variant="count">128</span>
<span soneBadge variant="destructive">99+</span>
<button soneBadge variant="outline" type="button">Filter: Design</button>
<span soneBadge variant="dashed">Local only</span>
<span soneBadge variant="secondary" interactive>Interactive</span>
</div>
<div class="demo-row" style="align-items: center">
<span soneBadge variant="secondary">
design
<button soneBadgeRemove aria-label="Remove design"><sone-icon icon="close" /></button>
</span>
<span soneBadge variant="accent">
roadmap
<button soneBadgeRemove aria-label="Remove roadmap"><sone-icon icon="close" /></button>
</span>
</div>
</div>インポート
import {
SoneBadgeDirective,
SoneBadgeRemoveDirective,
} from "@surface-one/angular/badge";API リファレンス
SoneBadgeDirectiveディレクティブ
| 名前 | 型 | デフォルト |
|---|---|---|
variant | BadgeVariant | "default" |
dotA leading status dot in the badge's colour (the `<span class="badge-dot">` part, drawn for you). | boolean | false |
interactiveThe 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. | boolean | false |
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`.