A modern, accessible two-step registration form built with Next.js, TypeScript, and Tailwind CSS. Features smooth transitions, comprehensive validation, and a pixel-perfect design matching the Figma prototype.
- ✨ Two-step registration form with smooth transitions
- 🔒 Comprehensive client-side validation
- ♿ Fully accessible with ARIA attributes
- 📱 Responsive design
- 🎨 Pixel-perfect implementation
- 🔄 State preservation between steps
- Node.js 18.x or later
- npm or yarn
- Clone the repository:
git clone [repository-url]
cd registration-form
- Install dependencies:
npm install
# or
yarn install
- Start the development server:
npm run dev
# or
yarn dev
- Open http://localhost:3000 in your browser.
- First/Last Name: 2-50 characters, letters only
- Phone Number: UK format (07XXXXXXXXX)
- Test with these number for uk : 07890 123456
-
Form Navigation
- Try navigating between steps
- Verify state preservation
- Test back button functionality
-
Field Validation
- Submit empty fields
- Test invalid characters
- Try incorrect phone formats
-
Accessibility
- Navigate with keyboard
- Test with screen readers
- Verify ARIA attributes
├── app/
│ ├── components/
│ │ ├── registration/
│ │ │ ├── CountrySelectionModal.tsx
│ │ │ ├── CountrySelector.tsx
│ │ │ ├── FormFooter.tsx
│ │ │ ├── FormModals.tsx
│ │ │ ├── Step1Form.tsx
│ │ │ └── Step2Form.tsx
│ │ ├── ui/
│ │ │ ├── Input.tsx
│ │ │ └── PhoneInput.tsx
│ │ ├── Header.tsx
│ │ ├── Modal.tsx
│ │ ├── RegistrationForm.tsx
│ │ ├── StepIndicator.tsx
│ │ └── SuccessScreen.tsx
│ ├── constants/
│ │ └── countries.ts
│ ├── hooks/
│ │ └── useFormValidation.ts
│ ├── store/
│ │ └── useFormStore.ts
│ ├── types/
│ │ └── form.ts
│ ├── utils/
│ │ └── validation.ts
│ ├── __tests__/
│ │ └── RegistrationForm.test.tsx
│ ├── fonts/
│ │ ├── GeistVF.woff
│ │ └── GeistMonoVF.woff
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
├── public/
│ ├── Logo.svg
│ └── Vector.svg
├── .eslintrc.json
├── jest.config.ts
├── jest.setup.ts
├── next.config.mjs
├── package.json
├── postcss.config.js
├── tailwind.config.js
└── tsconfig.json
-
registration/
: Contains all registration-specific componentsStep1Form.tsx
: First step of registration (name inputs)Step2Form.tsx
: Second step of registration (phone input)CountrySelector.tsx
: Country selection componentFormFooter.tsx
: Footer with terms and continue buttonFormModals.tsx
: Terms and privacy policy modals
-
ui/
: Reusable UI componentsInput.tsx
: Base input componentPhoneInput.tsx
: Specialized phone input with country code
-
hooks/
: Custom React hooksuseFormValidation.ts
: Form validation logic
-
store/
: State managementuseFormStore.ts
: Zustand store for form state
-
utils/
: Utility functionsvalidation.ts
: Form validation rules and functions
-
types/
: TypeScript type definitionsform.ts
: Form-related types and interfaces
Would you like me to make any other adjustments to the structure documentation?