Active Lesson - Search Coins

You have built the charts, the data tables, and the pagination. Now, you face the most dynamic component of any application: The Global Search.

In a tutorial, I would just teach you the code functionality and you’ll "follow-along" blindly. But in the real world, you get a set of requirements and your mission is to connect the dots and implement that functionality.

Your Goal is to Build a SearchModal that opens with a keyboard shortcut (Cmd+K), searches for coins via API as the user types, handles loading states gracefully, and allows navigation to the coin's detail page.

Know Your Tools

Before you write a single line of code, you must understand tools through which you’ll be building this feature. You aren't just using standard React state here; you are using industry-standard patterns for performance and user experience.

#1: SWR (Stale-While-Revalidate)

You might be tempted to use a simple useEffect to fetch data when the input changes.