shadcn-syntax-toast-sonner
Installation
SKILL.md
shadcn ui : Toast (Sonner) Syntax
Sonner is the sole notification-toast primitive in shadcn ui as of 2026. The previous Radix-based Toast component and its companion useToast() hook were REMOVED per the shadcn changelog. The shadcn registry now ships a single Toaster wrapper around the upstream sonner package (see apps/v4/registry/new-york-v4/ui/sonner.tsx), and all toast calls go through the imperative toast() API imported directly from sonner.
REMOVAL NOTICE : useToast is gone
If your project has any of the following, it is dead code from a pre-2026 shadcn project and MUST be removed :
import { useToast } from "@/components/ui/use-toast": the filecomponents/ui/use-toast.tsno longer exists in the registry. Delete the import.import { Toast, ToastProvider, ToastViewport } from "@/components/ui/toast": the filecomponents/ui/toast.tsx(Radix-based) no longer exists. Delete the import.const { toast } = useToast(): the hook is gone. Replace withimport { toast } from "sonner"(a top-level import, NOT a hook).<Toaster />from@/components/ui/toaster: the old file atcomponents/ui/toaster.tsx(the Radix viewport) no longer exists. Replace with<Toaster />from@/components/ui/sonner.
See the migration table at the bottom of this skill for line-by-line replacement.