lara-light-indigo

Badge

Badge is a small status indicator for another element.

Numbers
284123
Positioned Badge
210+
Button Badge
Sizes
246
Getting Started

Badge can be used as a component.

Component

import { Badge } from 'primereact/badge';
 

Content of the badge is specified using the value property.


<Badge value="2"></Badge>
 
Severities

Different color options are available as severity levels. When used as a component use the severity property to apply a severity.

  • success
  • info
  • warning
  • danger

<Badge value="2" severity="success"></Badge>
 
Button Badges

Buttons provide integrated badge support with the badge and badgeClass properties.


<Button type="button" label="Emails">
    <Badge value="2"></Badge>
</Button>

<Button type="button" label="Messages" icon="pi pi-users" className="p-button-warning">
    <Badge value="8" severity="danger">
</Button>
 
Sizes

Badge sizes are adjusted with the size property that accepts "large" and "xlarge" as the possible alternatives to the default size.


<Badge value="2"></Badge>
<Badge value="4" size="large" severity="warning"></Badge>
<Badge value="6" size="xlarge" severity="success"></Badge>
 

In addition, when placed inside another element, badge sizes can also derive their size from their parent.


<h1>Heading 1 <Badge value="New"></Badge></h1>
<h2>Heading 2 <Badge value="New"></Badge></h2>
 
Properties

Any valid attribute is passed to the root element implicitly, extended properties are as follows;

NameTypeDefaultDescription
valueanynullValue to display inside the badge.
severitystringnullSeverity type of the badge.
sizestringnullSize of the badge, valid options are "large" and "xlarge".
Styling

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-badgeBadge element
p-overlay-badgeWrapper of a badge and its target.
p-badge-dotBadge element with no value.
p-badge-successBadge element with success severity.
p-badge-infoBadge element with info severity.
p-badge-warningBadge element with warning severity.
p-badge-dangerBadge element with danger severity.
p-badge-lgLarge badge element
p-badge-xlExtra large badge element
Accessibility

This section is under development. After the necessary tests and improvements are made, it will be shared with the users as soon as possible.

Dependencies

None.

Component Scale

Input Style

Ripple Effect

Free Themes

Built-in component themes created by the PrimeReact Theme Designer.

Bootstrap
Blue
Purple
Blue
Purple
Material Design
Indigo
Deep Purple
Indigo
Deep Purple
Material Design Compact
Indigo
Deep Purple
Indigo
Deep Purple
Tailwind
Tailwind Light
Fluent UI
Blue
PrimeOne Design - 2022 NEW
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
PrimeOne Design - 2021
Saga Blue
Saga Green
Saga Orange
Saga Purple
Vela Blue
Vela Green
Vela Orange
Vela Purple
Arya Blue
Arya Green
Arya Orange
Arya Purple
Premium Themes

Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.

Soho Light
Soho Dark
Viva Light
Viva Dark
Mira
Nano

Legacy Free Themes

Nova
Nova Alt
Nova Accent
Luna Blue
Luna Green
Luna Amber
Luna Pink
Rhea

Premium Create-React-App Templates

Beautifully crafted premium create-react-app application templates by the PrimeTek design team.

Sakai
Atlantis
Freya
Ultima
Diamond
Sapphire
Serenity
Babylon
Avalon
Apollo
Roma