gitmyhub

sonner

TypeScript ★ 12k updated 5mo ago

An opinionated toast component for React.

A simple React component for showing brief pop-up notification messages, like 'File saved' or 'Something went wrong', that appear at the edge of the screen and disappear on their own.

TypeScriptReactsetup: easycomplexity 1/5

Sonner is a small React component that displays toast notifications: the brief pop-up messages that appear at the edge of a screen to confirm an action or deliver a status update, then disappear on their own. Examples include "File saved", "Link copied", or "Something went wrong".

To use it, you install the package, place a single ` component somewhere near the top of your app, and then call toast('Your message here')` from anywhere else in your code when you want a notification to appear. There is no need to manage the positioning or timing yourself.

The README for this project is brief and points readers to an external documentation site for the full API. Based on what is provided here, the library focuses on simplicity: one component to set up, one function to trigger notifications.

Where it fits