SnackbarHost(
modifier = Modifier.align(Alignment.BottomCenter),
hostState = snackbarHostState,
snackbar = { snackbarData: SnackbarData ->
Card(
shape = RoundedCornerShape(8.dp),
border = BorderStroke(2.dp, Color.White),
modifier = Modifier
.padding(16.dp)
.wrapContentSize()
) {
Column(
modifier = Modifier.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Icon(imageVector = Icons.Default.Notifications, contentDescription = "")
Text(text = snackbarData.message)
}
}
}
)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter