CustomSnackbarVisuals

data class CustomSnackbarVisuals(val message: String, val actionLabel: String? = null, val withDismissAction: Boolean = false, val duration: SnackbarDuration = SnackbarDuration.Short, val isError: Boolean = false, val icon: ToolkitIcon? = null, val colors: ToolkitSnackbarColors? = null, val content: @Composable (SnackbarData) -> Unit? = null) : SnackbarVisuals(source)

A custom implementation of androidx.compose.material3.SnackbarVisuals to provide additional styling options, such as displaying an error state.

Constructors

Link copied to clipboard
constructor(message: String, actionLabel: String? = null, withDismissAction: Boolean = false, duration: SnackbarDuration = SnackbarDuration.Short, isError: Boolean = false, icon: ToolkitIcon? = null, colors: ToolkitSnackbarColors? = null, content: @Composable (SnackbarData) -> Unit? = null)

Properties

Link copied to clipboard
open override val actionLabel: String?

The text to be displayed for the action button. If null, no action will be shown.

Link copied to clipboard

Replace the colours of the snackbar's style.

Link copied to clipboard

Draws this snackbar instead of the Toolkit's, for a screen that wants its own. It receives the snackbar's data, to perform its action or dismiss it.

Link copied to clipboard
open override val duration: SnackbarDuration

The duration for which the snackbar will be displayed.

Link copied to clipboard

Drawn before the message.

Link copied to clipboard

A boolean flag to indicate if the snackbar represents an error. This can be used to apply different styling (e.g., a red background color) to the snackbar.

Link copied to clipboard
open override val message: String

The primary text to be displayed in the snackbar.

Link copied to clipboard

The look isError picks.

Link copied to clipboard
open override val withDismissAction: Boolean

Whether the snackbar should have a dismiss action.