androidx.compose.material3

rememberTooltipState

Function

No hand-written docs yet.

Create and remember the default TooltipState for TooltipBox.

Parameters

@Composable
fun rememberTooltipState(
    initialIsVisible: Boolean = false,
    isPersistent: Boolean = false,
    mutatorMutex: MutatorMutex = BasicTooltipDefaults.GlobalMutatorMutex,
): TooltipState

initialIsVisible: BooleanOptional

Default: false

the initial value for the tooltip's visibility when drawn.

isPersistent: BooleanOptional

Default: false

Boolean that determines if the tooltip associated with this will be persistent or not. If isPersistent is true, then the tooltip will only be dismissed when the user clicks outside the bounds of the tooltip or if TooltipState.dismiss is called. When isPersistent is false, the tooltip will dismiss after a short duration. Ideally, this should be set to true when there is actionable content being displayed within a tooltip.

mutatorMutex: MutatorMutexOptional

Default: BasicTooltipDefaults.GlobalMutatorMutex

MutatorMutex used to ensure that for all of the tooltips associated with the mutator mutex, only one will be shown on the screen at any time.

Library docs

Create and remember the default TooltipState for TooltipBox.