---
title: "Password Reset"
description: "Collects and confirms a replacement password - the new password with its rules, the confirmation, and the done state."
slug: "password-reset"
---

import { DocPage, PageHeader, SkillPanel, SourceFiles, DocLink, SkillField, SkillText, SkillRow, ApiPill } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="password-reset" title="Password Reset" component="password-reset">
  Collects and confirms a replacement password - the new password with its rules, the confirmation, and the done state. Part of the <DocLink href="website-account-states.html">Account & States</DocLink> blocks.
</PageHeader>

<SkillPanel component="password-reset">
  <SkillField label="Native basis">
<SkillText>A card: the new password (<code>autocomplete="new-password"</code>, <code>minlength</code>, rules in <code>aria-describedby</code>) and its confirmation, then submit. <code>data-variant="done"</code> confirms and links back to sign in.</SkillText>
  </SkillField>

  <SkillField label="Built from">
<SkillText><DocLink href="input.html">Input</DocLink>, <DocLink href="label.html">Label</DocLink>, <DocLink href="button.html">Button</DocLink>.</SkillText>
  </SkillField>

  <SkillField label="Web Platform APIs">
<SkillRow>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete" title="the browser fills known fields"><code>autocomplete</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation" title="required, type and pattern - the browser checks the form"><code>Constraint validation</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/:user-invalid" title="errors show only after the user tried"><code>:user-invalid</code></ApiPill>
  </SkillRow>
  </SkillField>

  <SkillField label="Classes">
<SkillRow>
    <code>.mk-password-reset</code>
    <code>.mk-password-reset-head</code>
    <code>.mk-auth-field</code>
    <code>.mk-password-reset-row</code>
    <code>.mk-password-reset-foot</code>
    <code>.mk-password-reset-rules</code>
    <code>.mk-password-reset-icon</code>
  </SkillRow>
  </SkillField>

  <SkillField label="Data attributes">
<SkillText><code>data-variant="done"</code>.</SkillText>
  </SkillField>
</SkillPanel>

```html example label="Default" hint="Both fields use autocomplete=&quot;new-password&quot; so the browser can generate and fill one strong password; minlength checks it and the rules are its description." previewStyle="align-items:stretch;"
<section class="mk-password-reset" aria-labelledby="pr-title">
  <div class="mk-password-reset-head"
    ><span class="mk-password-reset-icon"><i data-lucide="lock-keyhole"></i></span
    ><h1 id="pr-title">Set a new password</h1><p>For anna@example.com</p></div
  >
  <form action="#" method="post">
    <div class="mk-auth-field"
      ><label class="label" for="pr-new">New password</label
      ><input
        class="input"
        id="pr-new"
        type="password"
        name="password"
        autocomplete="new-password"
        minlength="12"
        required
        aria-describedby="pr-rules"
      /><ul class="mk-password-reset-rules" id="pr-rules"
        ><li>12 characters or more</li
        ><li>Not one you used before</li></ul
      ></div
    >
    <div class="mk-auth-field"
      ><label class="label" for="pr-confirm">Confirm new password</label
      ><input
        class="input"
        id="pr-confirm"
        type="password"
        name="confirm"
        autocomplete="new-password"
        minlength="12"
        required
    /></div>
    <button class="btn" type="submit">Update password</button>
  </form>
</section>
```

```html example label="Done" hint="data-variant='done': the password changed - other sessions were signed out - and the way to sign in." previewStyle="align-items:stretch;"
<section class="mk-password-reset" data-variant="done" role="status" aria-labelledby="pr2-title">
  <div class="mk-password-reset-head"
    ><span class="mk-password-reset-icon"><i data-lucide="check"></i></span><h1 id="pr2-title">Password updated</h1
    ><p>We signed you out on your other devices.</p></div
  >
  <a class="btn" href="#">Sign in</a>
</section>
```

<SourceFiles component="password-reset" section="css" />

</DocPage>
