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

Responsive sign up form with CSS Grid and Zod validation

accessibility, jest, next, react-testing-library, zod
P
radkr•60
@radkr
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?

Proud of:

  • I used the Zod schema-based validation library. Even if this project does not necessarily need this complexity, I wanted to get experience with it.
  • I implemented validation both on submission and on lost focus as well to enhance user experience.
  • I wrote unit tests for more complex scenarios than before.

Would I do differently:

  • Next time, I will think ahead about how to implement the layout. In this project, I started with css flex, but then I chose css grid to prevent glitches in the responsive design.
What challenges did you encounter, and how did you overcome them?

Next.js assumes the application will be served from the root of a domain (e.g. mydomain.com/) and its routing and asset handling are configured accordingly. Github Pages, however will host them from a subpath in the format <account_name>.github.io/<repository_name>/. I found the tutorials and documentations on the internet controversial, but in the end, I believe I found a good solution to the problem while I also learned a lot about the next.js build process and configuration.

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

I found a solution for preventing replacing the subpath manually on css url()s when hosting this Next.js project on Github Pages myself. (See the end of the readme section of "Next.js static assets on Github Pages") I am very curious if this solution has any downside that I do not see for now.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on radkr's solution.

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

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

Frontend Mentor

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

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