Whiskydog / frontendmentor-interactive-card-details-form

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - Interactive card details form solution

This is a solution to the Interactive card details form challenge on Frontend Mentor.

Overview

The challenge

Users should be able to:

  • Fill in the form and see the card details update in real-time
  • Receive error messages when the form is submitted if:
    • Any input field is empty
    • The card number, expiry date, or CVC fields are in the wrong format
  • View the optimal layout depending on their device's screen size
  • See hover, active, and focus states for interactive elements on the page

Screenshot

Links

My process

Built with

What I learned

I learned how to use react-hook-form for building forms and provide easy validation.

Also utilized CSS Modules to the best of my abilities for encapsulation of CSS styles. Although please feel free to provide any feedback on my frontendmentor profile, it's my first time using CSS Modules. Vite.js really streamlines this process because it supports Modules out of the box.

I'm still getting a grasp of media queries to implement responsive design.

I was somewhat learned on React.js before this project, however it always amazes me its flexibility. Keeping the card component in sync with the form inputs was fairly straightforward thanks to React.

Useful resources

I always make sure to check documentation:

Also this is an useful series of articles for dipping your toes in CSS Modules:

  1. What are CSS Modules and why do we need them?
  2. Getting Started with CSS Modules
  3. CSS Modules and React

Author

About


Languages

Language:JavaScript 61.1%Language:CSS 35.7%Language:HTML 3.3%