ui icon indicating copy to clipboard operation
ui copied to clipboard

feat: Individual Toast Duration

Open rkwap opened this issue 1 year ago • 3 comments

  • PR includes addition of duration prop on individual toast trigger.

Example:

toast({
  variant: "default",
  title: "Notified",
  duration: 2000,
});

rkwap avatar Feb 05 '24 15:02 rkwap

@rkwap is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Feb 05 '24 15:02 vercel[bot]

Individual toast times can already be configured at the toast level.

toast({
  duration: 5000,
  title: "Hello World",
});

This comes from Radix UI's toast here, which has per-toast duration.

kevinmitch14 avatar Feb 16 '24 20:02 kevinmitch14

@kevinmitch14 @rkwap The issue here is that TOAST_REMOVE_DELAY is automatically set to such a large number (it's at 1000000 in both default and new york styles), that even after that duration runs out, the toast will not dismiss for a super long time.

I think we should consider changing TOAST_REMOVE_DELAY to something more sensible, though I've set it to 0 in my local copy.

cboornaz17 avatar May 19 '24 03:05 cboornaz17