TooltipState


The state that is associated with a TooltipBox. Each instance of TooltipBox should have its own TooltipState.

Summary

Public functions

Unit

Dismiss the tooltip associated with this TooltipState if it's currently being shown.

Cmn
Unit

Clean up when the this state leaves Composition.

Cmn
suspend Unit
show(mutatePriority: MutatePriority)

Show the tooltip associated with the current TooltipState.

Cmn

Public properties

Boolean

Boolean that determines if the tooltip associated with this will be persistent or not.

Cmn
Boolean

Boolean that indicates if the tooltip is currently being shown or not.

Cmn
MutableTransitionState<Boolean>

The current transition state of the tooltip.

Cmn

Public functions

dismiss

fun dismiss(): Unit

Dismiss the tooltip associated with this TooltipState if it's currently being shown.

onDispose

fun onDispose(): Unit

Clean up when the this state leaves Composition.

show

suspend fun show(mutatePriority: MutatePriority = MutatePriority.Default): Unit

Show the tooltip associated with the current TooltipState. When this method is called all of the other tooltips currently being shown will dismiss.

Parameters
mutatePriority: MutatePriority = MutatePriority.Default

MutatePriority to be used.

Public properties

isPersistent

val isPersistentBoolean

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.

isVisible

val isVisibleBoolean

Boolean that indicates if the tooltip is currently being shown or not.

transition

val transitionMutableTransitionState<Boolean>

The current transition state of the tooltip. Used to start the transition of the tooltip when fading in and out.