Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEXT: Toasts #2398

Closed
endigo9740 opened this issue Jan 3, 2024 · 5 comments
Closed

NEXT: Toasts #2398

endigo9740 opened this issue Jan 3, 2024 · 5 comments
Assignees
Labels
React - Incomplete The React portion of this feature is incomplete Svelte - Incomplete The Svelte portion of this feature is incomplete
Milestone

Comments

@endigo9740
Copy link
Contributor

endigo9740 commented Jan 3, 2024

Warning

This issue is a work in progress.

This will act as a hub to centralize this information.

Framework Status

  • Svelte 5: Incomplete
  • React: Incomplete

Maintainer Requests

The following requests are coming straight from the Skeleton team. These are highly likely be implemented:

  • (see also Modals and Drawers)
  • Ability to set up a default timeout for Toasts
  • (expect this to expand over time)

Community Requests

The following requests have come from the community and are under consideration:

Bugs and Issues

  • n/a

Feedback

If you have additional updates or requests for this feature, please do so in the comments section below.

@endigo9740 endigo9740 added enhancement New feature or request feature request Request a feature or introduce and update to the project. labels Jan 3, 2024
@endigo9740 endigo9740 added this to the v3.0 (Next) milestone Jan 3, 2024
@endigo9740 endigo9740 added Svelte - Incomplete The Svelte portion of this feature is incomplete React - Incomplete The React portion of this feature is incomplete and removed enhancement New feature or request feature request Request a feature or introduce and update to the project. labels Jan 3, 2024
@jwatts777
Copy link
Contributor

Toasts could be more useful with custom event options.
Ex.(tentative)
on:toastDisplay={toastAnimHandle}
on:toastActionBtnClicked={fireActionFunc}
on:dismissBtnClicked={userDoesntWantToast}

@Typogram
Copy link

Typogram commented Feb 5, 2024

Toast should have custom element for Dismiss button. Allow me to put my own button in the inside Toast, and attach an identifier to designate it as the dismiss button.

All my other close button in my UI system is using a specific svg icon, it bothers me that the close button in Toast looks different.

@endigo9740
Copy link
Contributor Author

endigo9740 commented Feb 6, 2024

Hey Typograph, I'm expecting us to converge on an API that's the best parts of modals/drawers/toasts, including the potential for serving fully custom components as the toasts if you so choose. One way or another, we'll definitely cover this use case.

@cycle4passion
Copy link

I am trying to handle an array of toast, and have them show/dismiss in a staggered fashion...

import { getToastStore, type ToastSettings } from '@skeletonlabs/skeleton';
const toastStore = getToastStore();

let toasts: {message:string, type: 'success'|'error'} = [
  { message: "Toast1", type: "success" },
  { message: "Toast2", type: "error" },
  { message: "Toast3", type: "success" }
];

toasts.forEach((each) => {
  setTimeout(() =>
    toastStore.trigger({
      message: each.message,
      hideDismiss: true,
      background: each.type !== 'error' ? 'variant-filled-success' : 'variant-filled-error'
  } as ToastSettings), 1000);
});
</script>

but they seem to show/hide nearly all at the same time. Stackblitz minimal repro https://stackblitz.com/edit/skeletonlabs-repl-mshrcf?file=src%2Froutes%2F%2Bpage.svelte

@endigo9740
Copy link
Contributor Author

endigo9740 commented May 24, 2024

In v3, we're going to combine modals/drawers/toasts into a unified "overlay system":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
React - Incomplete The React portion of this feature is incomplete Svelte - Incomplete The Svelte portion of this feature is incomplete
Projects
None yet
Development

No branches or pull requests

4 participants