Badge
Une étiquette compacte pour un statut, un compteur ou un tag, avec six variantes et quatre teintes de statut.
Disponible pour
Angular: disponible Vue: disponible React: disponible React Native: disponible
Utilisation
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>Importation
import {
SoneBadgeDirective,
SoneBadgeRemoveDirective,
} from "@surface-one/angular/badge";Référence de l’API
SoneBadgeDirectiveDirective
| Nom | Type | Par défaut |
|---|---|---|
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 |
SoneBadgeRemoveDirectiveDirective
`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`.