Snackbar
The snackbar component consists, at minimum, of a container and a message. It also supports leading content such as an icon or trailing tertiary button.
Type | Resource |
---|---|
Design | Figma |
Web | Web Storybook |
Code | Gitlab |

Usage
import id.co.biofarma.binduiandroid.components.snackbar.Snackbar
fun Snackbar(
id: String = "",
variant: String = "default",
type: String = SnackbarType.SIMPLE.value,
message: String = "default",
actionLabel: String? = "default",
iconShow: Boolean = true,
isIcon: Any? = null,
mode: String = ThemeMode.LIGHT.value,
snackbarHostState: SnackbarHostState,
dismissAction: (() -> Unit)? = null
)
Examples
Type
Use type for change the type of snackbar component: simple
, action
, close

Variant
Use variant for change variant type of snackbar component: default
, primary
, secondary
, warning
, info
, danger

Mode (Optional)
Use mode for change color mode of snackbar component: light
or dark

Props
Props | Required | Default | Type | Description |
---|---|---|---|---|
id | false | - | string | The unique identifier for the Snackbar component, useful for accessibility or targeting specific elements. |
variant | false | default | default primary secondary warning info danger | Specifies the variant of the Snackbar, determining its visual style (e.g., default, primary, secondary, warning, info, or danger). |
type | false | simple | simple action close | Defines the type of Snackbar. simple is a basic notification, action includes an action button, and close includes a close button. |
message | true | - | string | The message to be displayed in the Snackbar, typically describing the notification or alert. |
actionLabel | false | - | string? | Optional label for an action button inside the Snackbar, such as “Retry” or “Dismiss”. |
iconShow | false | true | boolean | A flag that indicates whether to show an icon inside the Snackbar (e.g., for success, error, etc.). |
isIcon | false | null | Any? | An optional icon to display inside the Snackbar. This can be an image, vector, or custom composable icon. |
mode | false | light | light dark | Defines the theme mode of the Snackbar. It can be either light or dark , adjusting the visual theme. |
snackbarHostState | true | - | SnackbarHostState | The state for managing the visibility and interactions of the Snackbar. Typically passed from a SnackbarHost . |
dismissAction | false | null | (() -> Unit)? | An optional dismiss action, which is invoked when the Snackbar is dismissed, either by the user or automatically. |