Feat: Page Check Your Email
Implementing a User-Friendly Confirmation Page for Password Recovery
In the process of recovering a password, users often need to confirm that their request has been successfully submitted. This is where the "Check your email" confirmation page comes into play. In this article, we will delve into the implementation of this page, focusing on its UI design and functionality.
Design Requirements
Before we dive into the implementation, let's take a look at the design requirements for this page.
Description
The confirmation page should include the following elements:
- A centered card with an envelope graphic and checkmark overlay
- A heading that reads "Check your email"
- Helper text that matches the design, which should read "We've sent an email with the next steps, check your inbox and follow along."
- A navy-blue "Return to login" button
Acceptance Criteria
To ensure that the page is implemented correctly, we have the following acceptance criteria:
- A new route
/password-recovery/sent
is registered and renders<RecoverySentPage />
- The card header reads "Check your email" and helper text matches design
- The envelope graphic with checkmark is centered above the text
- The "Return to login" button uses navy background, white text, and is the same width as other form buttons
- Clicking "Return to login" navigates back to
/login
- The page uses design-system tokens for typography, spacing, and colors
- The page is responsive: the card remains centered on desktop and full-width on mobile
- The page is accessible: all elements have proper aria roles and keyboard focus states
Implementation
Now that we have a clear understanding of the design requirements and acceptance criteria, let's move on to the implementation of the page.
Centered Card with Envelope Graphic and Checkmark Overlay
To create the centered card with an envelope graphic and checkmark overlay, we can use the following HTML and CSS code:
<div class="card">
<div class="envelope">
<div class="checkmark"></div>
</div>
<h2>Check your email</h2>
<p>We've sent an email with the next steps, check your inbox and follow along.</p>
<button class="return-to-login">Return to login</button>
</div>
.card {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
background-color: #f7f7f7;
border: 1px solid #ddd;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.envelope {
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 10px;
margin-bottom: 20px;
}
.checkmark {
width: 20px;
height: 20px;
background-color: #4CAF50;
border-radius: 50%;
position: absolute;
top: 50%;
: 50%;
transform: translate(-50%, -50%);
}
.return-to-login {
background-color: #2E4053;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 10px;
cursor: pointer;
}
.return-to-login:hover {
background-color: #3B5998;
}
Responsive Design
To ensure that the page is responsive, we can use media queries to adjust the layout and styling based on the screen size.
@media (max-width: 768px) {
.card {
flex-direction: column;
align-items: center;
}
.envelope {
width: 50px;
height: 50px;
}
.checkmark {
width: 10px;
height: 10px;
}
.return-to-login {
padding: 10px 15px;
}
}
Accessibility
To ensure that the page is accessible, we can add ARIA attributes to the elements and use semantic HTML.
<div class="card" role="alert" aria-label="Password recovery confirmation">
<div class="envelope" role="img" aria-label="Envelope graphic">
<div class="checkmark" role="img" aria-label="Checkmark overlay"></div>
</div>
<h2 id="heading" role="heading" aria-level="2">Check your email</h2>
<p id="helper-text" role="paragraph" aria-label="Helper text">We've sent an email with the next steps, check your inbox and follow along.</p>
<button id="return-to-login" class="return-to-login" role="button" aria-label="Return to login button">Return to login</button>
</div>
Conclusion
In this article, we implemented a user-friendly confirmation page for password recovery, focusing on its UI design and functionality. We used HTML, CSS, and JavaScript to create a centered card with an envelope graphic and checkmark overlay, and added ARIA attributes to ensure accessibility. We also used media queries to ensure that the page is responsive. By following these guidelines, you can create a similar confirmation page for your application.
Future Improvements
There are several ways to improve this confirmation page. Some suggestions include:
- Adding a timer to the page to indicate how long it will take for the email to be sent
- Providing a link to the email client to help users find the email in their inbox
- Adding a button to resend the email if it is not received
- Using a more modern design language to make the page more visually appealing
In our previous article, we implemented a user-friendly confirmation page for password recovery, focusing on its UI design and functionality. However, we know that there are many questions and concerns that developers may have when implementing such a page. In this article, we will address some of the most frequently asked questions and provide additional guidance on implementing a confirmation page for password recovery.
Q: What is the purpose of a confirmation page for password recovery?
A: The purpose of a confirmation page for password recovery is to inform the user that their password recovery request has been successfully submitted and to provide them with instructions on what to do next. This page helps to build trust with the user and provides a clear understanding of the next steps in the password recovery process.
Q: How do I implement a confirmation page for password recovery?
A: To implement a confirmation page for password recovery, you will need to create a new route in your application that renders the confirmation page. This route should be triggered when the user submits their password recovery request. You can use HTML, CSS, and JavaScript to create the page, and add ARIA attributes to ensure accessibility.
Q: What are some best practices for designing a confirmation page for password recovery?
A: Some best practices for designing a confirmation page for password recovery include:
- Using a clear and concise heading that indicates the purpose of the page
- Providing a brief summary of the next steps in the password recovery process
- Using a visually appealing design that is consistent with your application's branding
- Adding ARIA attributes to ensure accessibility
- Using media queries to ensure that the page is responsive
Q: How do I handle errors on the confirmation page for password recovery?
A: To handle errors on the confirmation page for password recovery, you can use a try-catch block to catch any errors that may occur when rendering the page. You can then display an error message to the user and provide instructions on how to resolve the issue.
Q: Can I customize the confirmation page for password recovery to fit my application's branding?
A: Yes, you can customize the confirmation page for password recovery to fit your application's branding. You can use HTML, CSS, and JavaScript to create a custom design that is consistent with your application's branding.
Q: How do I ensure that the confirmation page for password recovery is accessible?
A: To ensure that the confirmation page for password recovery is accessible, you can add ARIA attributes to the elements on the page. You can also use semantic HTML and CSS to create a page that is easy to navigate and understand.
Q: Can I use a third-party library to implement a confirmation page for password recovery?
A: Yes, you can use a third-party library to implement a confirmation page for password recovery. Some popular libraries include React, Angular, and Vue.js. You can also use a library like Bootstrap to create a custom design for the page.
Q: How do I test the confirmation page for password recovery?
A: To test the confirmation page for password recovery, you can use a combination of manual and automated testing techniques. You can test the page by submitting a password recovery request and that the page is rendered correctly. You can also use tools like Selenium to automate the testing process.
Q: Can I use a confirmation page for password recovery in a production environment?
A: Yes, you can use a confirmation page for password recovery in a production environment. However, you should ensure that the page is properly tested and validated before deploying it to production.
Conclusion
In this article, we addressed some of the most frequently asked questions and provided additional guidance on implementing a confirmation page for password recovery. We hope that this article has been helpful in answering your questions and providing you with the information you need to implement a user-friendly confirmation page for password recovery.