{"library":"react-hot-toast","title":"React Hot Toast Notifications","description":"react-hot-toast is a highly regarded, lightweight, and customizable React notification library designed to display \"smoking hot\" toast messages with minimal setup and a beautiful default aesthetic. Currently stable at version 2.6.0, the package maintains an active and responsive release cadence, frequently introducing new features and performance enhancements. Notable recent updates include support for multiple toasters in v2.6.0, enhanced React Server Components (RSC) compatibility for Next.js 13 App Router in v2.4.1, and significant bundle optimizations in v2.3.0. Its key differentiators include a powerful Promise API that automatically handles loading, success, and error states, an exceptionally small bundle size of less than 5kb, and versatile headless hooks (`useToaster`) for developers requiring complete control over the UI. The library is built with accessibility in mind and ships with TypeScript types, promoting robust and type-safe development practices. It provides a simple `Toaster` component and a `toast` function that can be called anywhere in your application.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-hot-toast"],"cli":null},"imports":["import toast from 'react-hot-toast';","import { Toaster } from 'react-hot-toast';","import { useToaster } from 'react-hot-toast';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import toast, { Toaster } from 'react-hot-toast';\nimport React from 'react';\n\nconst notify = () => toast('Here is your toast.');\n\nconst App = () => {\n  return (\n    <div>\n      <button onClick={notify}>Make me a toast</button>\n      <Toaster />\n    </div>\n  );\n};\n\nexport default App;\n","lang":"typescript","description":"This example demonstrates how to integrate `react-hot-toast` by adding the `Toaster` component once to your application and then triggering notifications using the `toast` function from any part of your code. It shows a basic button click initiating a simple toast.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}