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

Intro Component with Signup Form | React JS โš›๏ธ & CSS ๐ŸŽจ

Marzia Jaliliโ€ข7,250
@MarziaJalili
A solution to the Intro component with sign-up form challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


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

Man, React is amazing. I mean I've just started it and it opens all closed doors.

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

I struggle a lot with the useState of ReactJS, but I ended up with a long but viable file๐Ÿ˜Ž.

On the other hand, I just realized that my websites look different when they are run in other browsers.

I develop them with firefox, but then in chrome and microsoft edge they don't look as cool as they do in firefox.

SAD!!!

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

I know dude, I haven't gone with the most reacty of coding.

My react files looks just like the JavaScript ones, so please help me out to make it neater!!!

๐Ÿซก๐Ÿซก

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Aakash Vermaโ€ข9,500
    @skyv26
    Posted 6 months ago

    Hi @MarziaJalili,

    Suggestions for Enhancing Error Message Display ๐Ÿš€

    1๏ธโƒฃ Issue Observed: Error messages shift the layout slightly when users submit a form with empty inputs, disrupting the flow of the page. ๐Ÿ› ๏ธ

    2๏ธโƒฃ Suggestion: Use absolute positioning for error messages. This ensures the layout remains intact, providing a smoother and more seamless user experience. ๐ŸŒŸ

    3๏ธโƒฃ Expected Outcome: Error messages will appear without affecting the surrounding elements, enhancing the interaction with the form. ๐ŸŽฏ


    Example Implementation ๐Ÿ’ป

    Hereโ€™s a code snippet for reference:

    /* Style for error message */
    .error-message {
      position: absolute; /* Keeps the layout intact */
      color: red;
      font-size: 12px;
      margin-top: 5px;
    }
    
    /* Parent container for proper positioning */
    .form-group {
      position: relative; /* Ensures absolute positioning works within this container */
      margin-bottom: 20px;
    }
    
    <div class="form-group">
      <input type="text" placeholder="Enter your name" />
      <span class="error-message">This field is required.</span>
    </div>
    

    This approach keeps the error messages visually close to the input field without impacting the surrounding layout. Let me know your thoughts! ๐Ÿ˜Š

    Marked as helpful
  • Teodor Jenklerโ€ข4,040
    @TedJenkler
    Posted 6 months ago

    Hi @MarziaJalili,

    Nice project! Building on the previous feedback about layout shifts, you could enhance the user experience by adding a fade-in transform to error messages. This subtle animation can make the errors feel less abrupt and improve the overall flow. It's a good practice to consider small animations or transformations in areas like mobile navigation menus and alerts to create a smoother user experience.

    Additionally, I noticed your use of the <main> tag and a root div. In future projects, consider updating your index.html to replace div id="root" with a <main> element. This will help keep your code cleaner and more semantic.

    Great work so far!

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