Intro Component with Signup Form | React JS โ๏ธ & CSS ๐จ

Solution retrospective
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!!!
๐ซก๐ซก
Please log in to post a comment
Log in with GitHubCommunity feedback
- @skyv26
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 - @TedJenkler
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