xxxxxxxxxx
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
toast.configure();
toast("SuccessFull!", {
position: "top-right",
autoClose: 5000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
});
xxxxxxxxxx
val text = "Hello toast!"
val duration = Toast.LENGTH_SHORT
val toast = Toast.makeText(applicationContext, text, duration)
toast.show()
xxxxxxxxxx
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
toast.configure();
toast("Successfully Logged In");
xxxxxxxxxx
[assembly: Xamarin.Forms.Dependency(typeof(MessageAndroid))]
namespace Your.Namespace
{
public class MessageAndroid : IMessage
{
public void LongAlert(string message)
{
Toast.MakeText(Application.Context, message, ToastLength.Long).Show();
}
public void ShortAlert(string message)
{
Toast.MakeText(Application.Context, message, ToastLength.Short).Show();
}
}
}
xxxxxxxxxx
<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-header">
<img src="..." class="rounded me-2" alt="...">
<strong class="me-auto">Bootstrap</strong>
<small>11 mins ago</small>
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
</div>
<div class="toast-body">
Hello, world! This is a toast message.
</div>
</div>
xxxxxxxxxx
const CustomContainer: FunctionComponent<ToastContainerProps> = ({ children, props }) => {
return <div className="custom-container" {props}>{children}</div>;
};
<ToastProvider containerOptions={{ component: CustomContainer }}>
<App />
</ToastProvider>