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

Toast: can't use custom severity #7332

Open
1 of 4 tasks
SchwarzesWasser opened this issue Feb 26, 2025 · 0 comments
Open
1 of 4 tasks

Toast: can't use custom severity #7332

SchwarzesWasser opened this issue Feb 26, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@SchwarzesWasser
Copy link

SchwarzesWasser commented Feb 26, 2025

Describe the bug

Currently, I’m working on customizing components for our design system. This involves an animated icon to indicate waiting states. However, there’s no way to add a custom status right now because the add method, due to TypeScript constraints, doesn’t allow specifying custom values. I also noticed that all properties passed to the add method are forwarded to the message slot. But due to TypeScript, we can’t pass custom parameters, which further complicates customization or makes it impossible. Similarly, I wrote about the ConfirmationOptions type in the ConfirmDialog component. Adding a separate custom Toast with its own group isn’t a viable solution because if Toasts from different groups are triggered, they overlap with each other.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-exl2r6ct?file=src%2FApp.vue

Environment

  • Chrome:133.0.6943.127
  • MacOS 15.3.1

Vue version

3.5.12

PrimeVue version

4.0.7

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. const toast = useToast();
  2. Start use custom props in add method

Expected behavior

It already works as expected now. We need to refine the ToastMessageOptions type to allow specifying custom statuses and enable adding custom values to the add method. Also, note the ConfirmationOptions type, as it has the same issue with the require method. All properties passed to this method end up in the slot, but TypeScript restricts this.

@SchwarzesWasser SchwarzesWasser added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant