PolyHunter

Sonner

Hover decoration requires a fine pointer and hover support at widths of 768px or more. Phone and touch controls keep tap actions and keyboard focus without rollover effects.

Toast notifications powered by sonner, styled to match the Alert atom — per-status token colors, type styles, and a CloseIcon close button.

Playground

Live preview

Examples

Status variants

toast.success("Claim submitted", {
  description: "Your reward is on the way.",
});
toast.error("Claim failed", {
  description: "The hunt could not be verified.",
});
toast.info("Heads up", {
  description: "New hunts are available in your region.",
});
toast.warning("Session expiring", {
  description: "Your session ends in 5 minutes.",
});

// Every toast ships with a CloseIcon close button (Toaster sets
// closeButton by default) and keeps swipe-to-dismiss.

Code

import { Toaster } from "@npolyhunter/ui";
import { toast } from "sonner";

// Place <Toaster /> at the root of your app.
<Toaster />

// Trigger a toast anywhere in the tree.
toast.success("Claim submitted", {
  description: "Your reward is on the way.",
});

// Status variants: success / error / info / warning
toast.error("Claim failed", {
  description: "The hunt could not be verified.",
});

// Persistent toast (no auto-close)
toast.info("Heads up", { duration: Infinity });

Code

const [status, setStatus] = useState("success");
const [title, setTitle] = useState("Claim submitted");
const [description, setDescription] = useState("Your reward is on the way.");
const [durationMs, setDurationMs] = useState("4000");
const [persistent, setPersistent] = useState(false);
const [closeButton, setCloseButton] = useState(true);

const fire = () =>
  toast[status](title, {
    description,
    closeButton,
    // sonner: duration in ms; Infinity keeps the toast open
    duration: persistent ? Infinity : Number(durationMs),
  });

<Button onClick={fire}>Show toast</Button>

Used in

Includes use through shared UI components.

App