BadgedBox

fun UiTreeBuilder.BadgedBox(badge: UiTreeBuilder.() -> Unit, key: Any? = null, modifier: Modifier = Modifier, content: BoxScope.() -> Unit)(source)

Overlays badge content at the logical top-end corner of primary content.

Both regions remain eager children of one Box. The badge is declared last and therefore draws above primary content without affecting its measurement.

Receiver

active tree builder receiving the badged composite

Parameters

badge

content emitted into the top-end overlay region

key

optional stable sibling identity used during reconciliation

modifier

ordered configuration applied to the shared overlay container

content

primary content measured by the shared box

Samples

BadgedBox(badge = { Badge(count = 3) }) {
    Column {
        Text("Inbox")
        RichText(document)
    }
}