# BasicTooltipState

# BasicTooltipState

Artifact:[androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/BasicTooltip.kt+class:androidx.compose.foundation.BasicTooltipState)  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)
Common/AllAndroid/JVM
  - Cmn  

  ```
  @ExperimentalFoundationApi
  interface BasicTooltipState
  ```

*** ** * ** ***

The state that is associated with an instance of a tooltip. Each instance of tooltips should have its own[BasicTooltipState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState).

## Summary

|                                  ### Public functions                                   |
|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)           | [dismiss](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState#dismiss())`()` Dismiss the tooltip associated with this[BasicTooltipState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState)if it's currently being shown.                                                                                                                                         | Cmn |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)           | [onDispose](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState#onDispose())`()` Clean up when the this state leaves Composition.                                                                                                                                                                                                                                                                            | Cmn |
| `suspend `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [show](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState#show(androidx.compose.foundation.MutatePriority))`(mutatePriority: `[MutatePriority](https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority)`)` Show the tooltip associated with the current[BasicTooltipState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState). | Cmn |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isPersistent](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState#isPersistent()) [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)that determines if the tooltip associated with this will be persistent or not. | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isVisible](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState#isVisible()) [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)that indicates if the tooltip is currently being shown or not.                       | Cmn |

## Public functions

### dismiss

Cmn  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)  

```
fun dismiss(): Unit
```

Dismiss the tooltip associated with this[BasicTooltipState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState)if it's currently being shown.  

### onDispose

Cmn  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)  

```
fun onDispose(): Unit
```

Clean up when the this state leaves Composition.  

### show

Cmn  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)  

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

Show the tooltip associated with the current[BasicTooltipState](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState). When this method is called all of the other tooltips currently being shown will dismiss.  

|                                                                        Parameters                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| `mutatePriority: `[MutatePriority](https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority)` = MutatePriority.Default` | [MutatePriority](https://developer.android.com/reference/kotlin/androidx/compose/foundation/MutatePriority)to be used. |

## Public properties

### isPersistent

Cmn  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)  

```
val isPersistent: Boolean
```

[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)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[BasicTooltipState.dismiss](https://developer.android.com/reference/kotlin/androidx/compose/foundation/BasicTooltipState#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

Cmn  
Added in[1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.6.0)  

```
val isVisible: Boolean
```

[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)that indicates if the tooltip is currently being shown or not.