Skip to content

Add support for multiple toasters#383

Merged
timolins merged 23 commits intomainfrom
multi-toaster
Aug 15, 2025
Merged

Add support for multiple toasters#383
timolins merged 23 commits intomainfrom
multi-toaster

Conversation

@timolins
Copy link
Owner

@timolins timolins commented Jan 6, 2025

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

@vercel
Copy link

vercel bot commented Jan 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-hot-toast Ready Ready Preview Comment Aug 15, 2025 3:34pm

@github-actions
Copy link

github-actions bot commented Jan 6, 2025

size-limit report 📦

Path Size
dist/index.js 5.19 KB (+3.99% 🔺)
dist/index.mjs 4.89 KB (+4.36% 🔺)
headless/index.js 2.05 KB (+10.36% 🔺)
headless/index.mjs 1.77 KB (+12.44% 🔺)

@GitScorz
Copy link

Is this ready? I really need this, but the latest version is still 2.5.1.

@timolins
Copy link
Owner Author

I just published v2.6.0-beta.0, which adds support for multiple toasters. You can give it a try with npm i react-hot-toast@beta. Testers and feedback are much appreciated.

@maxratajczak
Copy link

I just published v2.6.0-beta.0, which adds support for multiple toasters. You can give it a try with npm i react-hot-toast@beta. Testers and feedback are much appreciated.

So far I've been testing/using the beta and it's working great 👍 Thanks!

@GitScorz
Copy link

I just published v2.6.0-beta.0, which adds support for multiple toasters. You can give it a try with npm i react-hot-toast@beta. Testers and feedback are much appreciated.

So far I've been testing/using the beta and it's working great 👍 Thanks!

Yes me too. Working perfectly.

@barrymay
Copy link

barrymay commented Feb 6, 2025

Been playing around with the multi-toaster feature in beta, works great! Looking forward to using it in non-beta. Thanks! :D

@georgiosApo
Copy link

Hey @timolins! Any chance this will be merged anytime soon? 😇
Cheers!

@alexdawes
Copy link

I've also been using this recently, and it works perfectly - a really nice addition!

Any chance this can be merged and released some time soon?

Thanks!

@amanzanero
Copy link

@timolins, Thanks for this! Curious if there's any blocker for having this merged? Also, it looks like this beta has a substantial number of weekly downloads!

@timolins timolins merged commit 85d4b21 into main Aug 15, 2025
4 checks passed
@timolins timolins deleted the multi-toaster branch August 15, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple <Toaster> elements

7 participants