Introducing PrimeReact v11-alpha 🎉Discover Now
styledMisc

Badge

Badge is a small status indicator for another element.

Approved Rejected Warning Pending Draft Featured 3 NewOnline PrivateSecurity issue
preview

Usage#

import { Badge } from '@primereact/ui/badge';
<Badge />

Examples#

Basic#

A small overlay on another element to indicate a count or status.

Badge
basic-demo

Severity#

The severity property defines the visual style of a badge.

DefaultSecondarySuccessInfoWarningDangerContrast
severity-demo

Size#

Use the size property to change the size of a badge.

SmallDefaultLargeXLarge
size-demo

Overlay#

A badge can be added to any element by encapsulating the content with the OverlayBadge component.

2
4
overlay-demo

Button#

Buttons have built-in support for badges to display a badge inline.

button-demo

API#

Sub-Components#

See Primitive API for Badge and OverlayBadge component documentation.

Hooks#

See Headless API for useBadge hook documentation.

Accessibility#

See Badge Primitive for WAI-ARIA compliance details and keyboard support.