ComposantsFondations
Badge
A short status or label: a tone, two sizes, an optional dot that can pulse.
- Domaine
- Fondations
- Niveau de support
- Taille
- 1.1 kB gzip, budget 0.7 kB
- Qui l'utilise
- 137 fichiers des produits et sites en production l'importent (Verikora : 44, Folioviv : 35, Sovkora : 31, krizaka.com : 1) Compté dans l'inventaire daté du 2026-11-23.
import { Badge } from "@krizaka/ui/badge";Live
tone
size
dot
pulse
<Badge tone="success" dot pulse>Live</Badge>Web et mobile — le même composant pour React et React Native. Stable : son API ne change qu’à une version majeure.
Pourquoi il est là. Used by Sovkora, Verikora, Folioviv, krizaka.com.
Quand l’utiliser
- To label the state of an item: paid, pending, new, live, ending soon.
- On a media (
tone="scrim"): a duration, a quality, a live marker. - With a
dot(andpulse) for something happening now.
Quand ne pas l’utiliser
Installation
Installer
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Importer
import { Badge } from "@krizaka/ui/badge";Exemples
Neutral
The default tone.
New
Accent
To highlight: new, featured.
New
Success
A good state: paid, verified.
Paid
Warning
A state that needs attention soon.
Pending
Danger with pulse
Urgent, happening now: the dot pulses.
Ends soon
On a media
tone="scrim": the veil and the text are identical in both themes.
4K
Medium
size="md" for a badge next to a heading.
Featured
Props
| Prop | Type | Défaut | Description |
|---|---|---|---|
dot | boolean | — | A small dot before the text, in the tone's colour (pulsing with pulse). |
pulse | boolean | — | Makes the dot pulse (stopped under reduced motion). |
size | "sm" | "md" | sm | sm · md. |
tone | "accent" | "success" | "warning" | "danger" | "neutral" | "scrim" | neutral | neutral · accent · success · warning · danger (soft tints, the text stays a text role) · scrim (on a media). |
Accessibilité
- A plain
<span>: its text is read with the content around it; the dot is decorative. - The colour is never the only signal: the words say the state.
- The pulse stops under
prefers-reduced-motion.
Bonnes pratiques
- One or two words: a badge is scanned, not read.
- Keep the tone meaningful:
success,warning,dangerfor states;accentto highlight;neutralotherwise. pulseonly for what is live: a page full of pulsing dots says nothing.
Composants liés
Générée depuis le code de @krizaka/ui 5.3.4 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub