Skip to content

SMS Resend Cooldown

A copy-paste login & auth component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Login & AuthHTMLCSSany framework
Verify your phone

Code sent to +1 •••-•••-4821

Copy into your project

HTML
<div class="nuda-au2-sms-cooldown">
  <div class="nuda-au2-sms-cooldown__icon" aria-hidden="true">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
      <rect x="6" y="2" width="12" height="20" rx="2"></rect>
      <line x1="11" y1="18" x2="13" y2="18"></line>
    </svg>
  </div>
  <div class="nuda-au2-sms-cooldown__title">Verify your phone</div>
  <p class="nuda-au2-sms-cooldown__sub">Code sent to +1 •••-•••-4821</p>
  <form>
    <label class="nuda-au2-sms-cooldown__label" for="au2-sms-code">One-time code</label>
    <input id="au2-sms-code" class="nuda-au2-sms-cooldown__input" type="text" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="000000" />
  </form>
  <button class="nuda-au2-sms-cooldown__resend" type="button" disabled aria-disabled="true">
    <span class="nuda-au2-sms-cooldown__bar" aria-hidden="true"></span>
    <span class="nuda-au2-sms-cooldown__resendtext" role="status">Resend in <span class="nuda-au2-sms-cooldown__count">20</span>s</span>
  </button>
</div>
CSS
.nuda-au2-sms-cooldown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  width: 100%;
  max-width: 280px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  text-align: left;
}

.nuda-au2-sms-cooldown__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(228,255,84,.1);
  color: #e4ff54;
}

.nuda-au2-sms-cooldown__icon svg {
  width: 18px;
  height: 18px;
}

.nuda-au2-sms-cooldown__title {
  color: #fafafa;
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.nuda-au2-sms-cooldown__sub {
  color: #777;
  font-size: 11px;
  margin: 0 0 4px;
}

.nuda-au2-sms-cooldown__label {
  color: #cfcfcf;
  font-size: 11px;
  display: block;
  margin-bottom: 6px;
}

.nuda-au2-sms-cooldown__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #fafafa;
  font-size: 15px;
  letter-spacing: .3em;
  text-align: center;
  outline: none;
  transition: border-color .2s,box-shadow .2s;
}

.nuda-au2-sms-cooldown__input:focus-visible {
  border-color: #e4ff54;
  box-shadow: 0 0 0 3px rgba(228,255,84,.15);
}

.nuda-au2-sms-cooldown__resend {
  position: relative;
  overflow: hidden;
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #777;
  font-size: 12px;
  cursor: not-allowed;
}

.nuda-au2-sms-cooldown__resend:focus-visible {
  outline: 2px solid #e4ff54;
  outline-offset: 2px;
}

.nuda-au2-sms-cooldown__bar {
  position: absolute;
  inset: 0;
  background: rgba(228,255,84,.14);
  transform-origin: left;
  transform: scaleX(1);
  animation: nuda-au2-sms-cooldown-drain 20s linear infinite;
}

.nuda-au2-sms-cooldown__resendtext {
  position: relative;
  z-index: 1;
}

.nuda-au2-sms-cooldown__count {
  color: #e4ff54;
  font-variant-numeric: tabular-nums;
}

@keyframes nuda-au2-sms-cooldown-drain {
  0% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-au2-sms-cooldown__bar {
    animation: none;
    transform: scaleX(0);
  }
}

How to use SMS Resend Cooldown

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More login & auth components

← Browse all NudaUI components