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

Notification presets #5769

Open
rolfsmeds opened this issue Apr 18, 2023 · 1 comment
Open

Notification presets #5769

rolfsmeds opened this issue Apr 18, 2023 · 1 comment
Labels

Comments

@rolfsmeds
Copy link
Contributor

Describe your motivation

Notifications are highly configurable: you can set a theme variant, a duration, and a position. This is good, as it gives developers a lot of flexibility in creating the kinds of notifications they want. But it doesn't provide good out-of-the-box defaults for common types of notifications.

Describe the solution you'd like

A number of notification presets (vaguely similar to the notification types in Vaadin 8) that provide good default presets for common types of notifications:

Info

  • Use case example: "New data available, click refresh to load it"
  • Theme variant: default (light gray)
  • Duration: 10 seconds
  • Position: top-center

Success

  • Use case example: "Process X finished succesfully"
  • Theme variant: success (green)
  • Duration: 5 seconds
  • Position: bottom-center

Warning

  • Use case example: "Your session will expire in 5 minutes"
  • Theme variant: warning (yellow)
  • Duration: persistent (non-auto-hiding)
  • Position: top-center

Error

  • Use cases example: "Something went wrong"
  • Theme variant: error (red)
  • Duration: persistent (non-auto-hiding)
  • Position: center
  • Should probably also be set to assertive

Describe alternatives you've considered

No response

Additional context

Would be nice if these presets were globally configurable somehow, but that can be a later enhancement, as these hardcoded presets will in no way affect existing applications or prevent the level of configurability we have today.

@yuriy-fix yuriy-fix added enhancement New feature or request theme vaadin-notification and removed theme labels Apr 19, 2023
@rolfsmeds
Copy link
Contributor Author

Actually bundling theme variants like this might be problematic since they are theme-specific: currently only the Lumo theme has them; Material has none and the application might be using neither (although that would be rather niche).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants