# IconMarker

## Functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarker.composable#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)( contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, size: https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerSize, contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, contentPadding: https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Renders a non-interactive icon marker (a dot `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerDefaults#DotIcon(androidx.compose.ui.Modifier)` by default) for anchoring to real-world objects. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarker.composable#IconMarker(kotlin.Function0,kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)( onClick: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier, size: https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerSize, color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, contentPadding: https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues, interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource?, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Renders a clickable icon marker (a dot `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerDefaults#DotIcon(androidx.compose.ui.Modifier)` by default) for anchoring to real-world objects. |

## Functions

### IconMarker

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/IconMarker.kt+function:IconMarker) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)

```
@Composable
fun IconMarker(
    contentDescription: String,
    modifier: Modifier = Modifier,
    size: IconMarkerSize = IconMarkerSize.Medium,
    contentColor: Color = IconMarkerDefaults.contentColor(),
    contentPadding: PaddingValues = IconMarkerDefaults.contentPadding(size),
    content: @Composable () -> Unit = { IconMarkerDefaults.DotIcon() }
): Unit
```

Renders a non-interactive icon marker (a dot `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerDefaults#DotIcon(androidx.compose.ui.Modifier)` by default) for anchoring to real-world objects. For cases where a custom icon is required, provide an `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Icon.composable#Icon(androidx.compose.ui.graphics.vector.ImageVector,kotlin.String,androidx.compose.ui.Modifier)` to `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)` slot.

Unlike the clickable `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarker.composable#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)`, this variant renders only the marker `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)` without an interactive background surface or click handling.

| Parameters |
|---|---|
| `contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | text used by accessibility services to describe a real-world object this marker is anchored to. This text should be localized. It will be merged with content description of the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)` so the latter one should be omitted. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this layout |
| `size: https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerSize = IconMarkerSize.Medium` | the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerSize` variant of the marker |
| `contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = IconMarkerDefaults.contentColor()` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` applied to `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)` |
| `contentPadding: https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues = IconMarkerDefaults.contentPadding(size)` | internal padding applied around `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)` |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html = { IconMarkerDefaults.DotIcon() }` | the marker content to display inside the surface. By default, this is a dot `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerDefaults#DotIcon(androidx.compose.ui.Modifier)`, but can be customized with an `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Icon.composable#Icon(androidx.compose.ui.graphics.vector.ImageVector,kotlin.String,androidx.compose.ui.Modifier)`. Size of the icon depends on the provided `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,kotlin.Function0)`. |

### IconMarker

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/IconMarker.kt+function:IconMarker) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)

```
@Composable
fun IconMarker(
    onClick: () -> Unit,
    contentDescription: String,
    modifier: Modifier = Modifier,
    size: IconMarkerSize = IconMarkerSize.Medium,
    color: Color = GlimmerTheme.colors.surface,
    contentColor: Color = IconMarkerDefaults.contentColor(color),
    contentPadding: PaddingValues = IconMarkerDefaults.contentPadding(size),
    interactionSource: MutableInteractionSource? = null,
    content: @Composable () -> Unit = { IconMarkerDefaults.DotIcon() }
): Unit
```

Renders a clickable icon marker (a dot `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerDefaults#DotIcon(androidx.compose.ui.Modifier)` by default) for anchoring to real-world objects. For cases where a custom icon is required, provide an `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Icon.composable#Icon(androidx.compose.ui.graphics.vector.ImageVector,kotlin.String,androidx.compose.ui.Modifier)` to `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.Function0,kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)` slot.

This variant renders a clickable icon enclosed in an interactive surface.

```kotlin
import androidx.xr.glimmer.Icon
import androidx.xr.glimmer.IconMarker

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

```kotlin
import androidx.xr.glimmer.Icon
import androidx.xr.glimmer.IconMarker

IconMarker(
    onClick = {},
    contentDescription = "Favourite meal",
    // The content description for the icon is redundant, as the marker merges the semantics.
    content = { Icon(FavoriteIcon, contentDescription = null) },
)
```

| Parameters |
|---|---|
| `onClick: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | called when this marker is clicked. |
| `contentDescription: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | text used by accessibility services to describe a real-world object this marker is anchored to. This text should be localized. It will be merged with content description of the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.Function0,kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)` so the latter one should be omitted. |
| `modifier: https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier = Modifier` | the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` to be applied to this layout |
| `size: https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerSize = IconMarkerSize.Medium` | the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerSize` variant of the marker |
| `color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = GlimmerTheme.colors.surface` | background `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` of the interactive surface |
| `contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = IconMarkerDefaults.contentColor(color)` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` applied to `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.Function0,kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)` |
| `contentPadding: https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues = IconMarkerDefaults.contentPadding(size)` | internal padding between the surface and `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.Function0,kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)` |
| `interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource? = null` | an optional hoisted `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/MutableInteractionSource` for observing and emitting interactions for this marker. Note that if `null` is provided, interactions will still happen internally |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html = { IconMarkerDefaults.DotIcon() }` | the marker content to display inside the surface. By default, this is a dot `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/IconMarkerDefaults#DotIcon(androidx.compose.ui.Modifier)`, but can be customized with an `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/Icon.composable#Icon(androidx.compose.ui.graphics.vector.ImageVector,kotlin.String,androidx.compose.ui.Modifier)`. Size of the icon depends on the provided `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/package-summary#IconMarker(kotlin.Function0,kotlin.String,androidx.compose.ui.Modifier,androidx.xr.glimmer.IconMarkerSize,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0)`. |