Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

Social links profile (React and Tailwind)

react, tailwind-css
mehdias63•330
@mehdias63
A solution to the Social links profile 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

  • Ehsan Tatasadi•1,800
    @tatasadi
    Posted over 1 year ago

    Hey,

    great job on completing this challenge! It's clear that there has been a commendable effort in structuring and styling these components. Utilizing Tailwind CSS for styling and a component-based approach for the profile card and buttons demonstrates a solid grasp of React principles and modern CSS frameworks. The selection of class names and styling properties points towards an aim for a responsive and visually appealing design.

    Nonetheless, to elevate the project further, a few enhancements are recommended to align more closely with best practices and the specific requirements of the challenge. Suggestions for Improvement

    Responsive Design Adjustments for Desktop: It seems the current implementation does not fully account for varying card width and padding that might be specified in the design for Desktop.

    Semantic Naming in Button Component: The use of title and text as prop names in your Button component could be optimized for clarity and semantic accuracy. Typically, the text prop might be expected to represent the button's visible label, whereas title could be misconstrued as the HTML title attribute, which is used to provide additional information on hover. A more intuitive approach would be to use label for the button's visible text and href for the hyperlink reference. This adjustment not only makes the code more readable but also ensures that the prop names accurately reflect their content and purpose.

    Improving Link Semantics and Accessibility: The current implementation of the Button component includes an <a> tag within a <button>, which could lead to semantic and accessibility challenges. The <button> element is ideally used for in-app actions, such as form submissions or activating JavaScript functions, while the <a> tag is designed for navigation purposes. Combining them might confuse users and assistive technologies about the element's intended function.

    A better practice is to style <a> tags as buttons when the goal is to create navigational links that look like buttons. This approach maintains semantic integrity and ensures optimal accessibility. With Tailwind CSS, you can easily apply button-like styles to an <a> tag, achieving the desired appearance without compromising on semantics or accessibility. For example:

    export default function Button({ label, href }) {
        return (
                <div className="m-2">
                  <a href={href} className="inline-block bg-gray text-sm font-bold leading-[1.3125rem] w-[17rem] py-3 rounded-md hover:bg-light-green cursor-pointer hover:text-black text-center">
                    {label}
                  </a>
                </div>
        );
    }
    

    This modification simplifies the component structure, aligns with accessibility standards, and ensures your application is accessible to all users, including those using assistive technologies.

    Great job on your progress so far, and keep up the good work!

    Marked as helpful

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