A tiny wrapper around sonner that automatically picks the best toast position based on device type.
Instead of hardcoding toast positions everywhere, this picks sensible defaults for you:
- Mobile → top-center
- Desktop → default sonner position
You can still override anything when you need to.
One toast position doesn’t fit every screen. This keeps UX clean without repeating device checks all over your code.
import { useToast } from "./use-better-toast";
const toast = useToast();
toast("Saved successfully");
toast("Custom", { position: "top-center" });This is just a thin layer over sonner, not a replacement.