Pokedex Example
A full-featured Pokedex app built with Crax. Uses the PokeAPI to browse, search, and favorite Pokemon.
Source code: github.com/craxjs/crax/packages/example
What it demonstrates
Pages
Home (/) - Grid of 12 Pokemon cards with pagination. Click a card for a quick-view modal with stats, types, and a link to the full detail page.
All Pokemon (/pokemon) - Full list, 20 per page with pagination. Each card links to the detail page with prefetch="foresight".
Detail (/pokemon/[id]) - Full Pokemon artwork, types, height, weight, base stat bars, and a heart button to toggle favorites. Uses <Head> for per-page SEO.
Favorites (/favorites) - Shows all favorited Pokemon. Reads from the global store. Empty state links to the Pokemon list.
Key files
State management
Favorites are stored in a single global store:
Any component can read favorites with useStore(favoritesStore) and get reactive updates when the store changes.
Running it
The app runs at http://localhost:5173.
