Skip to content

feat: toaster transition duration option#708

Closed
ynng3 wants to merge 1 commit intoemilkowalski:mainfrom
ynng3:main
Closed

feat: toaster transition duration option#708
ynng3 wants to merge 1 commit intoemilkowalski:mainfrom
ynng3:main

Conversation

@ynng3
Copy link
Contributor

@ynng3 ynng3 commented Nov 5, 2025

🚀 What's Changed
This PR introduces a new configuration option to the Toaster component, allowing users to control the speed of the transition animation.

  • Added a transitionDuration property (Number in milliseconds) to the toastOptions object.
  • This property dictates how long the toast's enter and exit animations (transitions) will last.

💡 Why This is Needed
As discussed in #690, the animation duration was previously fixed, which limited flexibility when integrating the component into different design systems.

This option resolves that by allowing developers to set the animation speed globally, ensuring the toast's appearance is perfectly synchronized with their application's UX flow—whether they need a lightning-fast notification or a leisurely slide-in.

🔧 How to Use
The duration can be set within the toastOptions when rendering the component:

<Toaster
  toastOptions={{
    // Set the transition duration to 400ms
    transitionDuration: 400,
  }}
/>
  • Default: (State the current hardcoded default duration, e.g., 400ms)
  • Unit: Milliseconds (ms)

@vercel
Copy link

vercel bot commented Nov 5, 2025

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

Project Deployment Preview Comments Updated (UTC)
sonner Ready Ready Preview Comment Nov 5, 2025 3:39pm

@ynng3 ynng3 changed the title add setting animation duration options #690 feat: toaster transition duration option Nov 5, 2025
@emilkowalski
Copy link
Owner

Thanks, but this is an opinionated to toast and I'd like to minimize the amount of animation customization. Hope this makes sense!

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.

2 participants

Comments