Zum Inhalt springen
Kitbay
Skill

ask-sonner

MITAktualisiert am 9. Nov. 202655.996GitHub-Sterne

A skill from Emil Kowalski's collection, written by the author of Sonner, for working with that React toast notification library.

Was der Skill vermittelt

A skill from Emil Kowalski's collection, written by the author of Sonner, for working with that React toast notification library. It covers mounting a single Toaster near the app root, including in Next.js layouts, calling toast from client code and returning results from server actions for the client to show. A table maps common needs to the right call, from plain and typed toasts to loading, promise-based, action and custom toasts, with recipes for updating, persisting or dismissing toasts. Styling moves from defaults through inline styles and classes to fully custom toasts. A troubleshooting table covers missing or doubled toasts, Tailwind classes, modals, dark mode and mobile offsets. A bundled API file gives exact props.

Funktionen

  • Set up Sonner toasts in a React or Next.js app
  • Pick the right toast call for a need
  • Style or fully customise toasts
  • Fix toasts that are missing, doubled or hidden