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

[object Object]

Example

<igx-avatar>
  <igx-badge icon="check" type="success"></igx-badge>
</igx-avatar>

IgxBadgeComponent

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:137

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:198

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:103

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:109

Sets/gets the id of the badge.

id: string

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

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:171

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:184

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:123

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: "square" | "rounded" = 'rounded'

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

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:74

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:88

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:233

Returns boolean

get infoClass(): boolean

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

Returns boolean

get successClass(): boolean

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

Returns boolean

get warningClass(): boolean

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

Returns boolean