Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Accessible rating component with React

Gakii 470

@G-Gakii

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What are you most proud of, and what would you do differently next time?

  • I used React to build the website.
  • My website is 100% accessible -Ability to keep the background colour of the rating button when I make a selection, which I couldn't accomplish the first time I created the project using HTML, CSS, and Javascript

What challenges did you encounter, and how did you overcome them?

Utilising usestate

What specific areas of your project would you like help with?

I would greatly appreciate a blog, video, or other resource that thoroughly explains useState. Although I've learned about useState, I'm still having some difficulties understanding it fully."

Community feedback

Ozzy-codes 130

@Ozzy-codes

Posted

Hi @G-Gakii!

Congrats on completing this project.

I forked your repo and made a pull request for how you may want to retain a background color on your circles! If you would like to see an alternative approach via radio buttons take a look at this repo from @llr3v0ll

Marked as helpful

0

Gakii 470

@G-Gakii

Posted

I like how you went about it.@Ozzy-codes

0
Lance 1,580

@IzykGit

Posted

Good work!

To keep the background color changed after the user has clicked on their number has two approaches.

First you could create a new class with all the same properties but change the background color and toggle these classes when a user clicks on a number. Or second you could directly change the background color of the clicked number in your javascript document document.getElementById("your-element).style.backgroundColor = "your color here".

These are two easy approaches that should help you fix your issue! Keep up the good work.

Marked as helpful

0

Gakii 470

@G-Gakii

Posted

Thank you, that was really beneficial.@IzykGit

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord