Skip to main content

Badge

The Badge component is a small visual indicator used to highlight status, notifications, or counts in your application.

Basic Usage

import { Badge, ThemeProvider } from "@carton-org/react-neumorphism";

const MyComponent = () => {
return <Badge size="md">New</Badge>;
};

Live Example

New

Props

NameTypeDescriptionRequiredDefault Value
insetbooleanWhether to use inset style for the badgeNofalse
size"xs" | "sm" | "md" | "lg" | "xl"Size of the badge. Can be one of the predefined sizes from the themeNo"sm"
childrenReact.ReactNodeContent to be displayed inside the badgeYes-
badgeStyleReact.CSSPropertiesCustom styles to apply to the badge containerNo-
badgeLabelStyleReact.CSSPropertiesCustom styles to apply to the badge label/textNo-

Examples

Different Sizes

Small Size

Small

Medium Size

Medium

Large Size

Large

Inset Style

Default Style

Default

Inset Style

Inset

With Custom Content

With Text

New Feature

With Number

42