react-hot-toast icon indicating copy to clipboard operation
react-hot-toast copied to clipboard

Add support for multiple toasters

Open timolins opened this issue 9 months ago • 8 comments

This PR implements the ability to have multiple toasters at once.

// Create a toaster with a custom id
<Toaster id="custom-toaster" />;

// Create a toast within the new toaster
toast.success('Nice toast!', {
  toasterId: 'custom-toaster',
});
<Toaster /> // Default toaster
<div>
  <Toaster
    toasterId="area1"
    containerStyle={{ position: 'absolute' }}
  />
</div>
<div>
  <Toaster
    toasterId="area2"
    containerStyle={{ position: 'absolute' }}
  />
</div>

Related issue

Closes #158

timolins avatar Jan 06 '25 10:01 timolins