Compose Playground

Badge

A small status descriptor for a UI element.

Properties
Preview
8
Generated Code
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Mail
import androidx.compose.material3.*
import androidx.compose.runtime.Composable

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MyBadge() {
    BadgedBox(
        badge = {
                Badge {
                    Text("8")
                }
        }
    ) {
        Icon(
            Icons.Filled.Mail,
            contentDescription = "Mail"
        )
    }
}