Badge

fun Badge(text: String, modifier: Modifier = Modifier, badgeAppearance: BadgeAppearance = BadgeAppearance.Standard, badgeVariant: BadgeVariant = BadgeVariant.Primary, icon: Painter? = null)

A badge is a non-interactive UI element that visually attracts attention and provides information about a specific item or its status. A badge can be a label by itself, or it can combine both a label and an icon. A badge cannot consist of only an icon.

For more information visit the ODS Core Documentation

Badge Sample

Parameters

text

Text to display in the badge. Overflows for more than two lines.

modifier

An optional Modifier to be applied to the badge. Defaults to Modifier.

badgeAppearance

An optional BadgeAppearance to be applied to the badge. Defaults to BadgeAppearance.Standard.

badgeVariant

An optional BadgeVariant to be applied to the badge. Defaults to BadgeVariant.Primary,

icon

An optional icon to display in the badge.