# Traffic Light > Build a traffic light component where the lights switch automatically in a continuous loop, following real-world traffic light timing. - Difficulty: intermediate - Tags: useState, useEffect - Estimated time: 20 minutes - Tests: 4 - Requires subscription: yes ## Overview Build a traffic light component where the lights switch automatically in a continuous loop, following real-world traffic light timing. ## Requirements - The traffic light should start with the red light active. - After a short period, it should switch automatically to green. - After another interval, it should switch to yellow. - After the full cycle, it should return to red and repeat indefinitely. - Only one light should be active at any given time. - The timing between color transitions must match the defined cycle durations. ## Notes - Each light should visually indicate when it is active or inactive. - Inactive lights must appear dimmed or covered by an overlay. - The sequence of transitions must repeat continuously without user interaction. - Ensure the timing of transitions aligns with the test expectations: - Red → Green after 2 seconds - Green → Yellow after a total of 3 seconds - Yellow → Red after a total of 3.5 seconds ## Tests 01. starts on red 02. changes to green after 2s 03. changes to yellow after 3000ms total 04. returns to red after full cycle 3500ms