// Create a javascript action and try this code. This will display the toast message wherever the JSA is called.
import { ToastAndroid } from 'react-native';
export async function ShowToastMessage(message) {
// BEGIN USER CODE
if (!message) {
console.warn("ShowToastMessage called without a message!");
return false;
}
ToastAndroid.show(message, ToastAndroid.SHORT);
return true;
// END USER CODE
}
There is no standard native toast/snackbar widget available out of the box in Mendix.
The usual built-in option is Show message, which can display blocking or non-blocking feedback. If your goal is simple messages like:
then using Show message in your nanoflow is the simplest and most straightforward approach.
If you need something that behaves like a real mobile toast/snackbar (non-blocking and auto-disappearing), then you will typically need:
There are Marketplace options like Simple Toast Notification or Feedback toast notification that provide this behavior.
So in practice:
A common pattern would be:
If you later want a more mobile-like UX, you can replace that step with a toast widget.
If this helps, please mark it as accepted.
Hi,
You’re right — in Mendix Native Mobile there is no out-of-the-box non-blocking toast/snackbar widget like in web. The standard Show message is modal, so it’s not suitable for lightweight feedback.
In practice, there are two approaches that work reliably.
This is the most common approach used in projects.
Mendix Native apps run on React Native, so you can call the native toast API via a JS action.
JS_ShowToast)Message
import { Platform, ToastAndroid, Alert } from "react-native";
export async function JS_ShowToast(message) {
if (Platform.OS === "android") {
ToastAndroid.show(message, ToastAndroid.SHORT);
} else {
// iOS does not have native toast, fallback
Alert.alert("", message);
}
}
If you need:
Then the proper solution is to create or use a custom native widget using a library like:
react-native-toast-messagereact-native-snackbarThis is how it’s done in more advanced apps, but it requires:
Mendix Native focuses on:
Non-blocking notifications like toast/snackbar are not part of the standard widget set, so you must extend using JS/native layer.
There is no out-of-the-box toast/snackbar widget in Mendix Native. The recommended approach is to use a JavaScript action to trigger a native toast (Android) and optionally implement a custom native widget if cross-platform behavior and styling are required.
If you want, I can give you a ready-made reusable toast module (JS action + usage pattern) you can plug into your app.