Krizaka UI
Krizaka UI
ComposantsFondations

Badge

A short status or label: a tone, two sizes, an optional dot that can pulse.

Web · ✓Mobile · ✓Bureau · ✓StableAffichage de données
Domaine
Fondations
Niveau de support
Stable
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";
Changez ses props : le composant se redessine, le code suit.
Live
tone
size
dot
pulse
tsx
<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 (and pulse) for something happening now.

Quand ne pas l’utiliser

  • For something the user can click or select.À la place : Chip
  • For a message the user must read.À la place : Alert
  • For a key figure with a trend.À la place : Stat

Installation

Installer

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@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

PropTypeDéfautDescription
dotboolean—A small dot before the text, in the tone's colour (pulsing with pulse).
pulseboolean—Makes the dot pulse (stopped under reduced motion).
size"sm" | "md"smsm · md.
tone"accent" | "success" | "warning" | "danger" | "neutral" | "scrim"neutralneutral · 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, danger for states; accent to highlight; neutral otherwise.
  • pulse only for what is live: a page full of pulsing dots says nothing.

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

Sur cette page