Create a Reusable Select Dropdown Component with Search in React — Accessible Searchable Dropdown with Virtualized List and Multi-Select
Build a production-grade reusable dropdown/select component with built-in search functionality. The component must be modular and reusable, with performance optimization for large datasets. Features: a trigger input that opens a popup panel on click, a search box inside the popup that filters options in real-time, a virtualized options list (only render visible options) for handling large datasets, single and multi-select modes, keyboard navigation (arrow up/down, Enter to select, Escape to close), ARIA attributes for accessibility, and a clear selection button. The component should be decomposed into sub-components: Trigger, Popup, SearchBox, OptionsList. This was asked in Razorpay's frontend interview with multiple performance-focused follow-up questions.