Skip to content

minhlong149/rest-countries-api

Repository files navigation

REST Countries API

This is a solution to the REST Countries API challenge on Frontend Mentor and Full Stack Open.

Table of contents

Overview

Features

  • 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

Screenshot

screenshot

Links

My process

Built with

What I learned

Lazy loading Images:

<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>

Useful resources

Author

About

React app featuring Tailwind CSS integrated with REST Countries API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published