Skip to main content

Badge

A small status indicator component for displaying notifications, counts, or status information.

Installation

import { Badge } from "@/core/components/Badge";

Basic Usage

import React from "react";
import { Badge } from "@/core/components/Badge";

export default function BadgeExample() {
return <Badge count={5} />;
}

Props

PropTypeDefaultDescription
countnumber-Number to display in the badge
variant"primary" | "secondary" | "success" | "warning" | "error""primary"Visual variant of the badge
size"sm" | "md" | "lg""md"Size of the badge
showZerobooleanfalseWhether to show badge when count is 0
maxnumber99Maximum count to display
styleStyleProp<ViewStyle>-Additional styles to apply

Usage Examples

Basic Badge

<Badge count={3} />

Different Variants

<Badge count={5} variant="primary" />
<Badge count={2} variant="success" />
<Badge count={1} variant="warning" />
<Badge count={8} variant="error" />

With Maximum Count

<Badge count={150} max={99} /> // Shows "99+"