Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

Interactive rating component

Mohamed Kabba•220
@Mohamedkabba444
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Smaylen5•600
    @Smailen5
    Posted 10 months ago

    Great solution 😉

  • Papi•280
    @Papi84
    Posted 10 months ago

    Semantic HTML:
    The use of semantic HTML is fundamental to both accessibility and SEO. After reviewing the code, I noticed that while the basic structure is in place, there could be improvements in how certain elements are tagged. For instance, instead of using a div for the rating buttons, you could consider using a fieldset with legend and input elements (such as radio buttons) to give the rating system better semantics. This would also enhance the accessibility of the component.


    ** Accessibility Improvements:**
    A few accessibility adjustments would improve the user experience for those using assistive technologies. Adding aria-labels or alt attributes to interactive elements can make sure screen readers convey the purpose of those elements. For example, labeling the rating buttons with more descriptive text or using aria-pressed to indicate the state of the rating selection would improve usability. Ensure that the focus state is visually distinct for keyboard navigation, and make sure the form can be submitted via the keyboard.


    ** Responsive Design:**
    The layout seems to work well on most screen sizes, but I noticed some room for improvement. On smaller screens, the content can become cramped. Consider using flexbox or grid with more media queries to ensure the component remains well-spaced and visually balanced on all screen sizes. It might help to add more spacing and adjust font sizes for smaller devices.


    ** Code Structure and Readability:**
    The code is generally clean and readable, but there are a few areas where it could be more efficient. You could break down repeated styles in the CSS into reusable classes to avoid redundancy. Additionally, ensuring consistent indentation and adding comments for sections of the code would enhance readability, especially for collaborators or future updates.


    ** Alignment with Design:**
    The solution closely follows the design in terms of structure and functionality. However, one area for improvement would be ensuring that the visual details—such as margins, paddings, and font sizes—match the design more precisely. This attention to detail can elevate the final product and make it feel more polished. Overall:
    Great effort on completing the project! The functionality works as expected, and with a few adjustments to semantic HTML, accessibility, and responsiveness, this project could really stand out. Keep up the good work, and refining these aspects will bring your skills to the next level.

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub