# SnackbarData

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

  ```
  interface SnackbarData
  ```

*** ** * ** ***

Interface to represent one particular `https://developer.android.com/reference/kotlin/androidx/compose/material/Snackbar.composable#Snackbar(androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,kotlin.Function0)` as a piece of the `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarHostState`

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarData#dismiss()()` Function to be called when Snackbar is dismissed either by timeout or by the user | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarData#performAction()()` Function to be called when Snackbar action has been performed to notify the listeners | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarData#actionLabel()` optional action label to show as button in the Snackbar | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarDuration` | `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarData#duration()` duration of the snackbar | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/SnackbarData#message()` text to be shown in the `https://developer.android.com/reference/kotlin/androidx/compose/material/Snackbar.composable#Snackbar(androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,kotlin.Function0)` | Cmn |

## Public functions

### dismiss

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

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

Function to be called when Snackbar is dismissed either by timeout or by the user

### performAction

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

```
fun performAction(): Unit
```

Function to be called when Snackbar action has been performed to notify the listeners

## Public properties

### actionLabel

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

```
val actionLabel: String?
```

optional action label to show as button in the Snackbar

### duration

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

```
val duration: SnackbarDuration
```

duration of the snackbar

### message

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

```
val message: String
```

text to be shown in the `https://developer.android.com/reference/kotlin/androidx/compose/material/Snackbar.composable#Snackbar(androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,kotlin.Function0)`