This is a solution to the Interactive rating component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the app depending on their device's screen size
- See hover states for all interactive elements on the page
- Select and submit a number rating
- See the "Thank you" card state after submitting a rating
- Solution URL: https://www.frontendmentor.io/solutions/interactive-rating-component-with-html-tailwind-css-and-vite-uxHc6XIJcf
- Live Site URL: https://interactive-rating-component-ndc.netlify.app/
- Semantic HTML5 markup
- TailwindCSS - A utility-first CSS framework
- Flexbox
- Grid
- Mobile-first workflow
- Vite - Next generation frontend tooling
I'm particularly proud of how I used radio buttons to track the selected rating instead of implementing some complex state management and a lot of DOM manipulations. At first I was thinking of bringing a lightweight DOM library like AlpineJS, but then I remembered that forms can track state and went for a simple solution.
There's a Stack Overflow thread I used to help me style a label based on the state of the radio input button it's linked to. You can check out the thread here.
- Frontend Mentor - @chiroro-jr
- Twitter - @chiroro_jr