API reference

Modifier Interface

Extension Functions

gazeImportantForInteraction ( important , interaction )
Sets the importance of a composable for Gaze and Hands interaction.
Controls how the composable participates in Gaze and Hands event handling. For details on each importance level, see ImportantForInteraction.
// Marks the composable as important for interaction.
Modifier.gazeImportantForInteraction()
// Marks the composable as explicitly not important for interaction.
Modifier.gazeImportantForInteraction(ImportantForInteraction.No)
// Marks the composable as important for interaction, but excludes all descendants from
// interaction.
Modifier.gazeImportantForInteraction(ImportantForInteraction.Yes) { excludeDescendants() }
// defaults to inferring interactability from accessibility, this is the same as just 'Modifier'
Modifier.gazeImportantForInteraction(ImportantForInteraction.Auto)

Signature
fun Modifier.gazeImportantForInteraction(
    important: ImportantForInteraction = ImportantForInteraction.Yes,
    interaction: InteractionScope.() -> Unit = {},
): Modifier
Extension declared in metavrx.gaze.compose.modifier
Parameters
important: ImportantForInteraction  The desired importance for Gaze and Hands interaction. Defaults to ImportantForInteraction.Companion.Yes.
interaction: InteractionScope.() -> Unit  Optional scope function to further customize interaction semantics.
Returns
Modifier  A Modifier with updated interaction importance for Gaze and Hands.
gazeTooltip ( text , tooltip )
Tells Gaze and Hands how to render a tooltip when the user hovers over the current composable.
Enables tooltips that appear when a user hovers over a UI element using Gaze and Hands interactions. The tooltip displays text and can be further customized via GazeHoverTooltipScope.
// Tooltip with text only
Modifier.gazeTooltip(stringResource(R.string.profile_settings_title))
// Tooltip with text and custom position
Modifier.gazeTooltip(
    text = stringResource(R.string.profile_settings_title),
 ) {
    position = TooltipPosition.Bottom // Tooltip appears below the composable
}

Signature
fun Modifier.gazeTooltip(text: String, tooltip: GazeHoverTooltipScope.() -> Unit = {}): Modifier
Extension declared in metavrx.gaze.compose.modifier
Parameters
text: String  The text to display in the tooltip.
tooltip: GazeHoverTooltipScope.() -> Unit  Optional lambda with GazeHoverTooltipScope for specifying additional tooltip arguments.
Returns
Modifier  A Modifier with the tooltip applied.