Skip to content

Forgot Password Form

Bootstrap 6 forgot password form with an email field, inline validation, a loading button, a stepper and a check-your-inbox success state with resend timer.

Also known as: password reset form, forgot password page, reset password email form, password recovery screen

Forgot Password Form live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

A two-panel forgot password form built with Bootstrap 6. A dark teal side panel explains the reset flow with the new CSS-only Stepper, and the form panel asks for an email address, validates it, simulates the request and then switches to a "Check your inbox" state with a resend timer.

How it works

The root .fpw-root holds .fpw-shell, a card that stacks on phones and becomes a two-column grid from 720px. The side panel .fpw-side holds the brand link, a decorative SVG and an ol.stepper.fpw-steps whose .stepper-item elements carry a data-fpw-step number.

The email field uses Bootstrap 6 field markup: a .form-field with a .form-label, a label.form-control.form-adorn that holds an envelope icon in .form-adorn-icon and the borderless input.form-ghost, plus .form-text help and an .invalid-feedback message.

script.js listens to the form's submit event and always calls preventDefault(). If the address fails the EMAIL_RE check, the input gets .is-invalid and aria-invalid="true". Bootstrap's .form-adorn:has(.form-ghost.is-invalid) rules then show the feedback, and focus returns to the field. A valid address disables the button, shows a .spinner-border.spinner-sm and waits 1.2 seconds. Then .fpw-request is hidden, .fpw-done is shown with the address in .fpw-sent-to, step 2 becomes active with aria-current="step", and focus moves to the success heading. .fpw-resend stays disabled while .fpw-wait counts down RESEND_SECONDS. .fpw-change returns to the form and selects the email.

Customization

  • --bs-primary-bg, --bs-primary-border and the other --bs-primary-* properties on .fpw-root: re-map the primary role, which recolors the submit and resend buttons. They point to --bs-teal-* by default.
  • --fpw-side and --fpw-accent on .fpw-root: change the side panel color and the yellow used by the active step, the brand icon and the SVG arrow.
  • --fpw-page on .fpw-root: changes the warm sand page background.
  • RESEND_SECONDS at the top of script.js: sets how long the resend button stays locked (30 seconds by default).
  • Replace the setTimeout in the submit handler with a fetch() POST to your reset endpoint, and call the same endpoint in the .fpw-resend click handler.

Use cases

  • Account recovery: an email field with inline validation starts the reset process
  • SaaS apps: a side panel explains the reset flow with a stepper
  • Login support: the button shows a loading state while the request is sent
  • Email flows: a check your inbox screen offers a resend timer

Accessibility

The section is labelled by its heading and the side panel by aria-label. The input has required, autocomplete="email" and aria-describedby that points to both the help text and the error. Invalid submits set aria-invalid and keep focus on the field. After success, focus moves to the new heading, and resends are announced through a polite role="status" region. All links and buttons keep a visible focus outline. The entrance animation on .fpw-done-in is turned off under prefers-reduced-motion.

Bootstrap 6 notes

Bootstrap 5's btn btn-primary is btn-solid theme-primary here, and btn-outline-primary is btn-outline theme-primary. The icon input uses form-adorn with form-ghost instead of an input-group-text. form-field replaces the old mb-3 wrapper, and spinner-sm replaces spinner-border-sm. The steps use the new .stepper component, and the tip is an alert theme-info. Built on Bootstrap 6.0.0-alpha.1, so class names may still change. Icons come from Bootstrap Icons.

Forgot Password Form at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Login & Sign Up
License
Free for personal and commercial use

Questions about this template

Can I use the Forgot Password Form code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Forgot Password Form – Bootstrap 6 login & sign up component screenshot
Forgot Password Form · Bootstrap 6 Login & Sign Up

More Login & Sign Up

Login Form with Floating Labels – Pure CSS login & sign up preview

Login Form with Floating Labels

Clean pure CSS login card with animated floating labels, show/hide password, inline validation and a simulated sign-in state in vanilla JavaScript.

Forgot Password Form – Tailwind CSS login & sign up preview

Forgot Password Form

Tailwind CSS forgot password form with email validation, loading spinner, check-your-inbox success state and a resend cooldown timer.

Signup Form with Validation – Bootstrap 5 login & sign up preview

Signup Form with Validation

Bootstrap 5 signup form with live password rules, a strength meter, show/hide toggle, password confirmation and a required terms checkbox.

Login and Signup Tabs – Bootstrap 6 login & sign up preview

Login and Signup Tabs

Bootstrap 6 card with segmented tabs that switch between a sign-in form and a create-account form, with validation, cross-links and simulated submits.

OTP Verification Form – Bootstrap 6 login & sign up preview

OTP Verification Form

Bootstrap 6 two-factor verification card using the new OtpInput component, with grouped digit slots, auto-submit, attempt limit, resend countdown and trust-device switch.

Split Login Page with Image – Bootstrap 6 login & sign up preview

Split Login Page with Image

Bootstrap 6 split-screen login page with a full-height photo and testimonial on one side and a floating-label form with Google and Apple sign-in on the other.