interactive-rating

Solution retrospective
To review the tailwind css and of course forms..
What challenges did you encounter, and how did you overcome them?The hardest part of this exercise was how to generate the scoring from 1 to 5 using semantic html and pass it to the next DOM element after submission.
At first I generated a button for each score, and suddenly realised that it seemed to make more sense to use radio while i was writing javascript, since the required action of a button in a form does not include passing data!
So I spent some more time with GPT, and fortunately both GPT and Grok suggested using a label + radio type input implementation. Also, you can rely on peer and checked to define the style of the sibling DOM element, wonderful !
keep learning... lol
Please log in to post a comment
Log in with GitHubCommunity feedback
- @vong0-0
What are you most proud of, and what would you do differently next time? I’m proud of the way I implemented the interaction flow and UI elements using React and TailwindCSS. The use of Tailwind allowed me to quickly style the component with minimal code, which kept the project lightweight and responsive. I'm also pleased with how I structured the components—separating the rating and thank-you dialogs into distinct components made the code more modular and readable.
Next time, I would pay more attention to the accessibility of the elements, especially when interacting with form elements like buttons and radio inputs. I’d also look into optimizing for different screen sizes to ensure the layout works well on all devices.
What challenges did you encounter, and how did you overcome them? The hardest part of the exercise was handling the rating submission and dynamically passing the rating value to the "Thank You" dialog. Initially, I thought of using buttons for each score, but after some consideration and research, I realized that using a radio button system would be semantically more appropriate for a rating scale.
I ran into a challenge in using buttons because they weren’t well suited for form submission (and I didn’t want to manipulate form behavior unnecessarily). The solution came when I found that using <label> and <input type="radio"> allowed me to take advantage of the form’s behavior while also making it easier to capture and pass the rating value to the next DOM element.
This is where GPT and Grok really helped me by suggesting this approach. I learned a lot about leveraging the peer and checked classes in Tailwind to style radio buttons and their labels dynamically, which was fantastic!
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