Overview
Setting up an Apple ID is the gateway to Apple's ecosystem, and a smooth onboarding experience is crucial. This problem challenges you to build a simplified multi-step form for creating an Apple ID profile. This ensures users can easily provide necessary information in a structured manner, enhancing the initial user experience and data collection integrity.
What you need to do / Task
Your task is to implement a multi-step form in React with the following structure and functionality:
- Step 1: Personal Information
- Fields:
First Name (text), Last Name (text), Email (email).
- Validation: All fields are required.
Email must be a valid email format.
- Step 2: Security Information
- Fields:
Password (password), Confirm Password (password).
- Validation: Both fields are required.
Password must be at least 8 characters long. Confirm Password must match Password.
- Navigation
- Implement "Next" and "Back" buttons to navigate between steps.
- The "Next" button should only proceed if the current step's form fields are valid.
- The "Back" button should always return to the previous step.
- On the last step, the "Next" button should be replaced by a "Submit" button.
- Submission
- Upon successful submission (all steps completed and valid), display a "Profile Created Successfully!" message along with a summary of the entered data (excluding passwords).
UI/UX expectations
- Layout: A central container for the form. Each step should clearly display its fields.
- Step Indicator: Optionally, a simple text indicator like "Step 1 of 2" could be shown.
- Inputs: Use standard HTML input types (
text, email, password) with clear label elements for accessibility.
- Buttons: Clearly labeled "Next", "Back", and "Submit" buttons.
- Validation Feedback: Display inline error messages for invalid fields.
- Accessibility: Ensure labels are associated with their respective input fields.
Acceptance criteria
- The form initially renders showing "Step 1: Personal Information".
- "Next" button successfully navigates from Step 1 to Step 2 when Step 1 fields are valid.
- "Back" button successfully navigates from Step 2 to Step 1.
- "Submit" button is visible only on Step 2.
- Clicking "Next" on Step 1 with invalid data prevents navigation and displays validation errors.
- Clicking "Submit" on Step 2 with invalid data prevents submission and displays validation errors.
- All form data is preserved when navigating between steps.
- Upon successful submission, a summary of the non-sensitive profile data is displayed, and the form elements are hidden.