Badge provides visual notifications used to decorate avatars, menus, etc.

Igx Module
IgxBadgeModule
Igx Theme
igx-badge-theme
Igx Keywords
badge, icon, notification
Igx Group
Data Entry & Display

Remarks

The Ignite UI Badge is used to decorate avatars, navigation menus, or other components in the application when visual notification is needed. They are usually designed as icons with a predefined style to communicate information, success, warnings, or errors.

Example

<div class="avatar-badge-container">
 <igx-avatar icon="person" shape="circle" size="small"></igx-avatar>
 <igx-badge icon="check" type="success" shape="square"></igx-badge>
</div>
new IgxBadgeComponent(): IgxBadgeComponent

Returns IgxBadgeComponent

Sets/gets the css class to use on the badge.

cssClass: string = 'igx-badge'

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:142

Example

@ViewChild("MyBadge", { read: IgxBadgeComponent })
public badge: IgxBadgeComponent;

badge.cssClass = 'my-badge-class';

Sets/gets whether the badge is displayed as a dot. When true, the badge will be rendered as a minimal 8px indicator without any content. Default value is false.

dot: boolean = false

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:204

Example

<igx-badge dot type="success"></igx-badge>

Sets/gets an icon for the badge from the material icons set.

icon: string

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:108

Remarks

If neither a value nor an icon is set the content of the badge will be empty. Providing an invalid value won't display anything.

Example

<igx-badge icon="check"></igx-badge>

The name of the icon set. Used in case the icon is from a different icon set.

iconSet: string

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:114

Sets/gets the id of the badge.

id: string

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:64

Remarks

If not set, the id will have value "igx-badge-0".

Example

<igx-badge id="igx-badge-2"></igx-badge>

Sets/gets the aria-label attribute value.

label: string = 'badge'

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:177

Example

@ViewChild("MyBadge", { read: IgxBadgeComponent })
public badge: IgxBadgeComponent;

badge.label = 'badge';

Sets/gets whether the badge is outlined. Default value is false.

outlined: boolean = false

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:190

Example

<igx-badge outlined></igx-badge>

Sets/gets the role attribute value.

role: string = 'status'

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:128

Example

@ViewChild("MyBadge", { read: IgxBadgeComponent })
public badge: IgxBadgeComponent;

badge.role = 'status';

Sets a square shape to the badge, if shape is set to square. By default the shape of the badge is rounded.

shape: "rounded" | "square" = 'rounded'

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:154

Example

<igx-badge shape="square"></igx-badge>

Sets/gets the type of the badge.

type: string = IgxBadgeType.PRIMARY

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:79

Remarks

Allowed values are primary, info, success, warning, error. Providing an invalid value won't display a badge.

Example

<igx-badge type="success"></igx-badge>

Sets/gets the value to be displayed inside the badge.

value: string | number = ''

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:93

Remarks

If neither a value nor an icon is set the content of the badge will be empty.

Example

<igx-badge value="11"></igx-badge>
get errorClass(): boolean

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:239

Returns boolean

get infoClass(): boolean

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:224

Returns boolean

get successClass(): boolean

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:229

Returns boolean

get warningClass(): boolean

Defined in projects/igniteui-angular/badge/src/badge/badge.component.ts:234

Returns boolean