This is a solution to the REST Countries API challenge on Frontend Mentor and Full Stack Open.
- Display countries from the API on the homepage, sorted by population
- Search for a country by its name or capital
- Filter countries by region
- Click on a country to see more detailed information on a separate page
- Click through to the border countries on the detail page
- Toggle the color scheme between light and dark mode
- View code solution: github.com/minhlong149/rest-countries-api
- Live site preview: minhlong149.github.io/rest-countries-api
- Semantic HTML5 markup
- CSS Grid & Flexbox
- Mobile-first workflow
- React - JS library
- Tailwind CSS - CSS framework
<img loading="lazy" src="..." />
Search bar with icon inside:
<div class="flex items-center">
<span class="material-icons">search</span>
<input
class="bg-transparent focus:outline-none"
placeholder="Search" type="text"
/>
</div>
Add floating point to big number for readability.
<p>Population: {country.population.toLocaleString()}</p>
Handle display to array that can either be empty or have multiple value.
<p>Capital: {country.capital?.join(", ") || "None"}</p>
- Search and Filter React Components by Spruce Emmanuel
- Tailwind CSS Official Document
- A Complete Guide to Grid by Chris House
- Github - Long Nguyen