BadgedBox

@Composable
fun BadgedBox(badge: @Composable BoxScope.() -> Unit, modifier: Modifier = Modifier, content: @Composable BoxScope.() -> Unit)

Material Design badge box.

A badge represents dynamic information such as a number of pending requests in a navigation bar.

Badges can be icon only or contain short text.

Badge image

A common use case is to display a badge with navigation bar items. For more information, see Navigation Bar

A simple icon with badge example looks like:

Parameters

badge

the badge to be displayed - typically a Badge

modifier

the Modifier to be applied to this BadgedBox

content

the anchor to which this badge will be positioned

Samples

androidx.compose.material3.samples.NavigationBarItemWithBadge