Kaapi UI
← Retour au Design System

Badge

Les badges sont utilisés pour afficher des statuts, des étiquettes ou des notifications de manière concise. Notre système supporte différentes combinaisons d'éléments visuels (point, icône, bouton, image, etc.).

1. Badge Simple & Couleurs

La couleur, la taille et la variante (forme) sont les props de base.

Formes (Variant)

pill-color

Fully rounded badge with background color.

<Badge variant="pill-color">pill-color</Badge>
color

Rectangular badge with slightly rounded corners.

<Badge variant="color">color</Badge>
modern

Rectangular badge with a subtle shadow (modern style).

<Badge variant="modern">modern</Badge>

Tailles (Size)

Badge smBadge mdBadge lg
<Badge size="sm|md|lg">Badge</Badge>

Couleurs (Color)

graybranderrorwarningsuccessblue
<Badge color="gray|brand|error|warning|success|blue">Color</Badge>

2. Composants Complexes

Ces composants utilisent la même API de base mais encapsulent des éléments spécifiques pour un usage plus riche.

BadgeWithDot (Statut)

En LigneEn AttenteHors Ligne
<BadgeWithDot color="success">En Ligne</BadgeWithDot>
<BadgeWithDot color="warning" variant="color">En Attente</BadgeWithDot>
<BadgeWithDot color="error" size="md">Hors Ligne</BadgeWithDot>

BadgeWithIcon

ProfilTéléchargerPayé
<BadgeWithIcon leftIcon={UserIcon} color="blue">Profil</BadgeWithIcon>
<BadgeWithIcon rightIcon={ArrowDown} variant="color">Télécharger</BadgeWithIcon>
<BadgeWithIcon leftIcon={ShieldDollar} variant="modern">Payé</BadgeWithIcon>

BadgeWithFlag / BadgeWithImage

FR flag
France
Badge image
Utilisateur
<BadgeWithFlag flag="FR">France</BadgeWithFlag>
<BadgeWithImage imgSrc="/images/avatar-1.png">Utilisateur</BadgeWithImage>

BadgeWithButton (Jetons/Filtres)

Filtre: UrgentErreur #233
<BadgeWithButton color="warning" onButtonClick={handleRemove}>Filtre: "Urgent"</BadgeWithButton>

BadgeIcon (Icône seule)

<BadgeIcon icon={Settings} color="gray" size="md" />
<BadgeIcon icon={Mail} color="brand" size="md" />
<BadgeIcon icon={Globe01} color="success" size="md" variant="color" />

BadgeGroup (Badge avec Addon)

Badge composite avec un élément addon (compteur, action) et alignement configurable.

Light Theme

New featureWe've just released a new feature

<BadgeGroup
    addonText="New feature"
    color="gray"
    theme="light"
    align="left"
    size="md"
>
    {"We've just released a new feature"}
</BadgeGroup>
ErrorThere was a problem with that action

<BadgeGroup
    addonText="Error"
    color="error"
    theme="light"
    align="left"
    size="md"
>
    There was a problem with that action
</BadgeGroup>
Just to let you know this might be a problemWarning

<BadgeGroup
    addonText="Warning"
    color="warning"
    theme="light"
    align="right"
    size="lg"
>
    Just to let you know this might be a problem
</BadgeGroup>
You've updated your profile and detailsSuccess

<BadgeGroup
    addonText="Success"
    color="success"
    theme="light"
    align="right"
    size="lg"
>
    {"You've updated your profile and details"}
</BadgeGroup>

Modern Theme

New featureWe've just released a new feature

<BadgeGroup
    addonText="New feature"
    color="gray"
    theme="modern"
    align="left"
    size="md"
>
    {"We've just released a new feature"}
</BadgeGroup>
New featureWe've just released a new feature

<BadgeGroup
    addonText="New feature"
    color="brand"
    theme="modern"
    align="left"
    size="md"
>
    {"We've just released a new feature"}
</BadgeGroup>
There was a problem with that actionError

<BadgeGroup
    addonText="Error"
    color="error"
    theme="modern"
    align="right"
    size="lg"
>
    {"There was a problem with that action"}
</BadgeGroup>
You've updated your profile and detailsSuccess

<BadgeGroup
    addonText="Success"
    color="success"
    theme="modern"
    align="right"
    size="lg"
>
    {" You've updated your profile and details"}
</BadgeGroup>

API Reference

ComponentPropsTypeDescription
Universal Props (valid for all badges):
Allvariant?'pill-color' | 'color' | 'modern'Badge shape/style variant.
Allcolor?'gray' | 'brand' | 'error' | 'warning' | 'success' | 'blue' The badge thematic color.
Allsize?'sm' | 'md' | 'lg'The badge size.
AllasChild?booleanAllows using a different component as the root element.
Variant-Specific Props:
BadgeWithIconiconLeading?IconComponentTypeIcon displayed before the text.
BadgeWithIconiconTrailing?IconComponentTypeIcon displayed after the text.
BadgeIconiconIconComponentTypeCentral icon (required).
BadgeWithFlagflag?FlagTypesCountry code to display a flag (e.g., "FR").
BadgeWithImageimgSrcstringURL of the image (avatar, logo) to display.
BadgeWithButtononButtonClick?MouseEventHandlerClick handler for the removal button.
BadgeWithButtonbuttonLabel?string(Accessible) label for the button.
BadgeGroupaddonTextstring | ReactNodeContent of the addon section (required).
BadgeGrouptheme?'light' | 'modern'Visual theme of the badge group.
BadgeGroupalign?'left' | 'right'Position of the addon section.
BadgeGrouprightIcon?IconComponentType | ReactNodeOptional trailing icon.