Overview
Intuit products, like QuickBooks and TurboTax, frequently handle large datasets such as financial transactions, invoices, or customer lists. Displaying these extensive lists efficiently without performance degradation is paramount for a smooth user experience. This problem challenges you to build a performant virtualized list component for financial transactions, ensuring a responsive UI even when dealing with thousands of items.
What you need to do / Task
Your primary task is to implement a VirtualizedList component that efficiently displays a large collection of financial transactions.
- Implement Virtualization: The
VirtualizedList component must only render the items currently visible within its viewport, plus a small buffer of items above and below, to minimize DOM elements.
- Display Transaction Data: Each transaction item in the list should clearly display its
id, description, amount, and date.
- Item Selection: Implement a basic selection mechanism. Clicking a transaction item should toggle its selected state (highlighted visually).
- Performance: Ensure the list scrolls smoothly without jank, even when populated with a very large number of items (e.g., 10,000+).
UI/UX expectations
- The list should be contained within a fixed-height scrollable container.
- Each transaction row must have a consistent, fixed height (e.g., 60px).
- Selected items should have a distinct background color or other visual indicator.
- The overall layout should be clean and readable, using the provided basic styles.
Acceptance criteria
- The
VirtualizedList component correctly renders the provided mock data.
- Scrolling performance is smooth and free of noticeable lag, even with thousands of items.
- Only a limited number of items (visible + buffer) are present in the DOM at any given time, verifiable via browser developer tools.
- Clicking on a transaction item correctly toggles its selection state, and the visual feedback updates instantly.
- The list maintains its scroll position reliably when items are selected/deselected or other state changes occur (no unexpected scroll jumps).