Skip to content

Slide toasts in and out past the same edge - #188

Merged
tmccoy14 merged 1 commit into
mainfrom
fix/toast-motion
Oct 6, 2026
Merged

tmccoy14 merged 1 commit into
mainfrom
fix/toast-motion

Conversation

@tmccoy14

@tmccoy14 tmccoy14 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Why

In Studio the toast felt abrupt and lopsided. It rose from the bottom in 150ms, fully opaque, then left by sliding out to the right. The right-hand exit is the shadcn default, borrowed from Radix's swipe-right gesture, so closing a toast normally reused the swipe-away motion.

What

Fixes (4.10.2)

One motion in and out. The toast now fades while it slides its full height from just past the viewport edge it sits on, and leaves the same way:

  • From sm up it sits bottom-right and moves to and from the bottom. Below sm it sits at the top and moves to and from the top.
  • It opens over 400ms with an ease-out curve, cubic-bezier(0.16, 1, 0.3, 1), and closes over 250ms with an ease-in curve.
  • A swiped-away toast fades where it was released instead of jumping to the close slide.
  • With prefers-reduced-motion, the toast only fades.

The tw-animate utilities are now plain keyframes in the CSS module. As utilities, the swipe-end and close rules would compete for the same animation, and which one won would depend on how Tailwind sorts them.

These values were tuned in Studio with a temporary override. Studio will drop that override when it bumps to this release.

Not in this PR

When a new toast replaces the current one, the old one still vanishes without an exit. ToastRoot remounts the provider on each new toast to work around Radix's stuck pause timer. Fixing it means revisiting that workaround, which is a separate change.

🤖 Generated with Claude Code

Need: a toast reads as one calm motion, arriving and leaving the same way.
Problem: it rose from the bottom in 150ms with no fade, then slid out to the right.
Solution: it fades while sliding past its viewport edge both ways, eases in over 400ms, and only fades under reduced motion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmccoy14
tmccoy14 merged commit 0aa5df5 into main Oct 6, 2026
1 check passed
@tmccoy14
tmccoy14 deleted the fix/toast-motion branch October 6, 2026 16:43
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.

1 participant