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) },
    )
}

Content updated: