Compose Component

IconMarker

Renders a clickable icon marker (a dot IconMarkerDefaults.DotIcon by default) for anchoring to real-world objects.

IconMarkerSample

@Sampled
@Composable
fun IconMarkerSample() {
    IconMarker(
        onClick = {},
        // Provide a description of the real-world object that the marker tracks.
        contentDescription = "Northern Cardinal",
    )
}

IconMarkerWithCustomIconSample

@Sampled
@Composable
fun IconMarkerWithCustomIconSample() {
    IconMarker(
        onClick = {},
        contentDescription = "Favourite meal",
        // The content description for the icon is redundant, as the marker merges the semantics.
        content = { Icon(FavoriteIcon, contentDescription = null) },
    )
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: