Toast Notifications
Note: This challenge focuses more on logic than UI. If you want to also focus on and practice UI, visit our UI Components challenges.
Objective: Implement a toast notification that allows displaying temporary messages that automatically disappear after a certain time.
Instructions:
- Create a function or component to show toast notifications with a message.
- Each notification should disappear automatically after a specified duration (e.g., 3 seconds).
- Provide the ability to trigger multiple notifications and display them in a queue.
Requirements:
- The toast notifications should be temporary and automatically disappear after a set time.
- Support multiple notifications at once, displayed in a queue (stacked on top of each other).
Hints:
- Use a timeout to control how long each notification stays visible.
- Use an array to manage multiple notifications and their removal from the list.
Bonus:
- Allow the user to dismiss a notification manually by clicking a close button.
- Add different types of notifications (e.g., success, error, info) with corresponding styles.