Basic Change Password
A three-field change-password form - current, new and confirm - with a show/hide toggle and live mismatch feedback.
3 फ्रेमवर्कशुरुआती
A change-password card that swaps to a confirmation panel with a check icon after submit.
<!-- Success panel. In the form state the same card holds the two fields and a submit button. -->
<div class="w-full max-w-sm rounded-2xl border border-gray-200 bg-white p-6 text-center shadow-sm dark:border-gray-800 dark:bg-gray-950">
<div class="mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-900/40">
<svg viewBox="0 0 24 24" class="h-6 w-6 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" stroke-width="2.5" aria-hidden="true">
<path d="m5 13 4 4 10-10" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</div>
<!-- role=status so the success message is announced when it replaces the form. -->
<div role="status">
<h2 class="mt-4 text-lg font-semibold text-gray-900 dark:text-gray-100">Password updated</h2>
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">Your new password is now active on this account.</p>
</div>
<button type="button"
class="mt-6 inline-flex w-full items-center justify-center rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm font-semibold text-gray-700 hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 dark:border-gray-700 dark:bg-transparent dark:text-gray-200 dark:hover:bg-gray-800">
Back to settings
</button>
</div>| Prop | टाइप | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
onSubmit | (values: { newPassword: string }) => void | - | सबमिट होने पर फ़ॉर्म के मानों के साथ कॉल होता है। |
className | string | - | रूट एलिमेंट पर मर्ज होने वाली अतिरिक्त क्लासेज़। |
On submit the same card replaces the fields with a `role="status"` success panel, so the confirmation is announced when it appears. A "Back to settings" button returns to the form; nothing here persists a credential - `onSubmit` is a no-op.