Native Toast Message

0
Hi everyone,I'm working on a Mendix Native Mobile app and I want to display a toast/snackbar notification to give the user quick feedback after an action (e.g., "Saved successfully" or "Error occurred").What I've tried so far:I looked at the Show message activity, but it shows a modal dialog — not a non-blocking toast. I also checked the Native Mobile Resources module but couldn't find a built-in toast widget.My question:Is there a native toast/snackbar widget available out of the box, or do I need to use a custom widget or JavaScript action? If so, what is the recommended approach in Mendix Studio Pro (version 10.x)?Any code snippet, nanoflow example, or Marketplace module reference would be very helpful!Thanks in advance
asked
3 answers
1
// 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
}


answered
1

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:

  • “Saved successfully”
  • “Something went wrong”
  • “Please fill this field”


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:

  1. a Marketplace widget/module
  2. a custom JavaScript action
  3. or a custom native widget


There are Marketplace options like Simple Toast Notification or Feedback toast notification that provide this behavior.


So in practice:

  • Out of the box → no dedicated toast/snackbar
  • Built-in option → use Show message
  • For real toast behavior → use a Marketplace module or custom implementation


A common pattern would be:

  • button tap
  • call nanoflow
  • perform logic (save/validate)
  • on success → Show message
  • on error → Show message


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.


answered
1

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.

Option 1 — Use a JavaScript action

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.

Steps

  1. Create a JavaScript action (e.g., JS_ShowToast)
  2. Add a string parameter: Message
  3. Use the following implementation:

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);
    }
}

  1. Call this JS action from your nanoflow after your logic.

Behavior

  • Android → native toast (non-blocking)
  • iOS → fallback (Alert). If you want true toast on iOS, you need a custom widget (see Option 2)

Option 2 — Custom Native Widget

If you need:

  • consistent UI across Android/iOS
  • snackbar-style UI
  • styling, duration, position

Then the proper solution is to create or use a custom native widget using a library like:

  • react-native-toast-message
  • react-native-snackbar

This is how it’s done in more advanced apps, but it requires:

  • Native widget setup
  • React Native knowledge

Why there is no built-in toast

Mendix Native focuses on:

  • Nanoflow-driven logic
  • Standard UI components

Non-blocking notifications like toast/snackbar are not part of the standard widget set, so you must extend using JS/native layer.

What most teams do

  • For simple feedback → JS action (ToastAndroid)
  • For production-grade UX → custom native widget

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.

answered