Overview
In many applications, visualizing a sequence of events chronologically is crucial for user understanding. Think of a project management tool displaying task progress, or a social media feed showing user activities. Your task is to build a basic vertical timeline component that can display a series of events, each with a title and a date, in a clear and intuitive manner.
What you need to do / Task
Your goal is to implement a Timeline React component that satisfies the following requirements:
- Display Events: Render a list of events provided via props as a vertical timeline.
- Chronological Order: Ensure events are displayed in chronological order, with the oldest event at the top and the newest at the bottom.
- Event Details: For each event, display its
title and date clearly.
- Visual Timeline Structure: Implement a visual representation of the timeline, typically a vertical line connecting distinct markers (e.g., dots or circles) for each event.
- Interactive Events: Make each event item clickable. When an event is clicked, an alert should be triggered displaying the
title of that specific event.
UI/UX expectations
- The timeline should be vertically oriented.
- Each event entry should be clearly distinguishable and contain its title and date.
- A visual vertical line should connect the event markers, indicating the flow of time.
- Each event should have a distinct marker (e.g., a circle, dot, or icon) aligned with the connecting line.
- Events should have a simple hover state to indicate interactivity.
Acceptance criteria
- The
Timeline component successfully renders all events from the provided mock data.
- Events are visually ordered from oldest to newest (top to bottom).
- Each rendered event clearly displays its title and date.
- A continuous vertical line and distinct markers are present, forming a clear timeline structure.
- Clicking on any event item triggers a browser
alert() showing the title of the clicked event.