otp-resend
A resend-code button that counts down first, then announces once that it is ready.
Example
Laravel
<x-admin::otp name="g_code" label="Enter the 6-digit code" />
<x-admin::otp-resend action="#" :after="30" class="mt" id="g-resend" />Props
| Prop | Required | Default | Options |
|---|---|---|---|
action | yes | ||
after | 60 | ||
method | "POST" | ||
label | null |
Other attributes, such as wire:model or data-*, pass through to the element.
Other stacks
React and Vue: import { OtpResend } from "@admiral/ui-kit/react" (or /vue). See the React and Vue guide.
HTML, for any stack
<div class="adm-field">
<label class="adm-label" for="g_code">Enter the 6-digit code</label>
<input
type="text"
name="g_code"
id="g_code" autocomplete="one-time-code"
maxlength="6"
inputmode="numeric" pattern="[0-9]*" required class="adm-input adm-otp" style="--_len:6;"
>
</div>
<form method="POST" action="#" class="adm-otp-resend mt" id="g-resend">
<button type="submit" class="adm-btn adm-btn--link" data-adm-countdown="30" ><span class="adm-countdown__label">Resend code</span></button>
<span class="adm-sr-only" aria-live="polite" data-adm-countdown-live></span>
</form>