next-toastv1.0.6
Documentation

Configuration

Set renderer defaults with props, or change them at runtime with toast.setConfig.

Renderer props

PropTypeDefaultPurpose
positionToastPosition"top-center"Stack position
richColorsbooleanfalseSemantic accents
closeButtonbooleanfalseClose control
maxVisiblenumber4Visible toast limit
unstyledbooleanfalseDisable style injection
Recommended setup
import { NextToast } from "next-toast";

<NextToast
  position="top-right"
  richColors
  closeButton
  maxVisible={4}
/>

Position

Choose top-left, top-center, top-right, bottom-left, bottom-center, or bottom-right.

Move the stack
toast.setConfig({ position: "bottom-right" });

Runtime configuration

Runtime changes affect current and future toasts.

toast.setConfig
toast.setConfig({
  position: "top-center",
  richColors: false,
  closeButton: false,
  maxVisible: 4,
});

External stylesheet and CSP

For strict Content Security Policies, import the packaged CSS and disable injection.

providers.tsx
import "next-toast/styles.css";
import { NextToast } from "next-toast";

export function Providers() {
  return <NextToast unstyled />;
}

Theme customization

Override scoped variables on .nx-toaster. Global root styles are untouched.

app.css
.nx-toaster {
  --nx-radius: 10px;
  --nx-success: #0d9488;
  --nx-font: "Inter", sans-serif;
}