Loading...

free
  • HTML
  • CSS
  • JS
  • API
4Advanced

REST Countries API with color theme switcher

If you're wanting to test your JavaScript skills this is the challenge for you. Use whichever JS framework you prefer and pull data from the REST Countries API.

Assets Provided

  • Sketch and Figma design file access - Unlock access with pro
  • JPEG design files for mobile & desktop layouts
  • Style guide for fonts, colors, etc
  • Optimized image assets
  • README file to help you get started
  • HTML file with pre-written content

Challenge

Brief

Your challenge is to integrate with the REST Countries API to pull country data and display it like in the designs.

You can use any JavaScript framework/library on the front-end such as React or Vue. You also have complete control over which packages you use to do things like make HTTP requests or style your project.

Your users should be able to:

  • See all countries from the API on the homepage
  • Search for a country using an input field
  • 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 (optional)

Download the starter code and go through the README.md file. This will provide further details about the project. The style-guide.md file is where you'll find colors, fonts, etc.

Want some support on the challenge? Join our Slack community and ask questions in the help channel.

Getting started

  1. Download the starter code

  2. Choose a JS framework/library and create your project

  3. Set up the project with version control (e.g. Git)

  4. Read the README.md file and have a look around the starter files

  5. Get colors, fonts etc from the style-guide.md file

  6. Set up your project/file architecture however you want

  7. Start coding!

Ideas to test yourself

  • Write your styles using a pre-processor, such as Sass, Less, Stylus or use a CSS-in-JS solution, like Styled Components

  • Try using Flexbox and Grid for layout

  • Practice working in a team by building with friends

challenge FAQs

Can I use libraries/frameworks on these projects?

Yes! Our challenges provide professional designs but there are no rules on what tools to use. So feel free to use anything you like to build your projects.

How can I get help if I'm stuck on a challenge?

The best (and quickest) way to get help on a challenge is in our Slack community. There are thousands of other developers in there, so it's a great place to ask questions. We even have a dedicated "help" channel! If you haven't joined yet, you can get an invite to our Slack community here.

Can I use these projects in my portfolio?

Definitely! Please do feel free to use whatever you build in your portfolio. Helping developers add professional-looking projects to their portfolio was one of the reasons we created this platform!

Is there an official solution I can take a look at?

We don't provide "official" solutions for the challenges. This is because there is no single perfect way to complete a challenge. Instead, you're encouraged to review other people's code in the community. You can learn so much by seeing how other people have approached the same challenges and giving them feedback.

Do I get a code review when I post my solution?

Frontend Mentor is a collaborative learning community where everyone can give feedback to each other. If you'd like to receive feedback from the community, please be sure to post a question when you submit your solution. The more specific you can be, the better. Being clear with your questions means you're much more likely to receive valuable feedback from others.

How do I submit my solution?

We'd recommend reading our complete guide to submitting solutions. If you get stuck and need help, please feel free to ask questions in our Slack community, and we'll help you submit your project.

Slack logo

Join our Slack community

Join over 50,000 people taking the challenges, talking about their code, helping each other, and chatting about all things front-end!