Badge

Functions summary

Unit
@Composable
Badge(
    modifier: Modifier,
    backgroundColor: Color,
    contentColor: Color,
    content: (@Composable RowScope.() -> Unit)?
)

Badge is a component that can contain dynamic information, such as the presence of a new notification or a number of pending requests.

Cmn

Functions

@Composable
fun Badge(
    modifier: Modifier = Modifier,
    backgroundColor: Color = MaterialTheme.colors.error,
    contentColor: Color = contentColorFor(backgroundColor),
    content: (@Composable RowScope.() -> Unit)? = null
): Unit

Badge is a component that can contain dynamic information, such as the presence of a new notification or a number of pending requests. Badges can be icon only or contain short text.

See BadgedBox for a top level layout that will properly place the badge relative to content such as text or an icon.

Parameters
modifier: Modifier = Modifier

optional Modifier for this item

backgroundColor: Color = MaterialTheme.colors.error

the background color for the badge

contentColor: Color = contentColorFor(backgroundColor)

the color of label text rendered in the badge

content: (@Composable RowScope.() -> Unit)? = null

optional content to be rendered inside the badge