JengaSnackbar

fun JengaSnackbar(message: String, modifier: Modifier = Modifier, tone: JengaSnackbarTone = JengaSnackbarTone.Neutral, actionLabel: String? = null, onAction: () -> Unit? = null, shape: Shape = JengaSnackbarDefaults.shape, colors: JengaSnackbarColors = JengaSnackbarDefaults.colors(), contentPadding: PaddingValues = JengaSnackbarDefaults.contentPadding, messageStyle: TextStyle = JengaSnackbarDefaults.messageStyle, actionStyle: TextStyle = JengaSnackbarDefaults.actionStyle)(source)

A transient message surface with an optional action.

This is the visual component; host it yourself (e.g. in a Box overlay or via your navigation shell). It does not manage its own visibility or timing.

Parameters

message

the message to show.

modifier

the Modifier for this snackbar.

tone

the semantic tone; see JengaSnackbarTone.

actionLabel

optional action label; when set with onAction, shows a trailing action.

onAction

called when the action is tapped.

shape

the snackbar shape; defaults to JengaSnackbarDefaults.shape.

colors

the color set; defaults to JengaSnackbarDefaults.colors.

contentPadding

padding inside the snackbar.

messageStyle

the message text style.

actionStyle

the action label text style.

Samples

JengaSnackbar(
    message = "Saved offline",
    tone = JengaSnackbarTone.Neutral,
    actionLabel = "Undo",
    onAction = { },
)