Codetive
Sign In
Coding challenges as of now are only available on desktop
On mobile you can try our quiz
Quiz
We are working hard to bring coding challenges with editor on mobile 💚

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:

  1. Create a function or component to show toast notifications with a message.
  2. Each notification should disappear automatically after a specified duration (e.g., 3 seconds).
  3. 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:

  1. Use a timeout to control how long each notification stays visible.
  2. Use an array to manage multiple notifications and their removal from the list.

Bonus:

  1. Allow the user to dismiss a notification manually by clicking a close button.
  2. Add different types of notifications (e.g., success, error, info) with corresponding styles.
Browser
Console
Tests
Soon