Skip to content

Re-auth Modal

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

Login & AuthHTMLCSSany framework

Copy into your project

HTML
<div class="nuda-au2-reauth-modal" role="dialog" aria-modal="true" aria-labelledby="au2-reauth-title">
  <div class="nuda-au2-reauth-modal__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="5" y="11" width="14" height="9" rx="2"></rect>
      <path d="M8 11V7a4 4 0 0 1 8 0v4" />
    </svg>
  </div>
  <h3 class="nuda-au2-reauth-modal__title" id="au2-reauth-title">Session expired</h3>
  <p class="nuda-au2-reauth-modal__sub">Enter your password to continue.</p>
  <form class="nuda-au2-reauth-modal__form">
    <label class="nuda-au2-reauth-modal__label" for="au2-reauth-pw">Password</label>
    <input id="au2-reauth-pw" class="nuda-au2-reauth-modal__input" type="password" autocomplete="current-password" required />
    <div class="nuda-au2-reauth-modal__actions">
      <button class="nuda-au2-reauth-modal__cancel" type="button">Sign out</button>
      <button class="nuda-au2-reauth-modal__cta" type="submit">Continue</button>
    </div>
  </form>
</div>
CSS
.nuda-au2-reauth-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  width: 100%;
  max-width: 300px;
  background: #161616;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  opacity: 0;
  transform: scale(.94) translateY(6px);
  animation: nuda-au2-reauth-modal-in .4s cubic-bezier(.16,1,.3,1) both;
}

.nuda-au2-reauth-modal__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-reauth-modal__icon svg {
  width: 18px;
  height: 18px;
}

.nuda-au2-reauth-modal__title {
  color: #fafafa;
  font-size: 15px;
  font-weight: 600;
  margin: 2px 0 0;
}

.nuda-au2-reauth-modal__sub {
  color: #a0a0a8;
  font-size: 11.5px;
  margin: 0;
}

.nuda-au2-reauth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.nuda-au2-reauth-modal__label {
  color: #cfcfcf;
  font-size: 11px;
}

.nuda-au2-reauth-modal__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #fafafa;
  font-size: 13px;
  outline: none;
  transition: border-color .2s,box-shadow .2s;
}

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

.nuda-au2-reauth-modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.nuda-au2-reauth-modal__cancel {
  flex: 1 1 0;
  min-height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: #cfcfcf;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s;
}

.nuda-au2-reauth-modal__cancel:hover {
  background: rgba(255,255,255,.06);
}

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

.nuda-au2-reauth-modal__cta {
  flex: 1 1 0;
  min-height: 44px;
  padding: 10px;
  background: #e4ff54;
  color: #0a0a0a;
  border: 0;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .2s,transform .15s;
}

.nuda-au2-reauth-modal__cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

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

@keyframes nuda-au2-reauth-modal-in {
  from {
    opacity: 0;
    transform: scale(.94) translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-au2-reauth-modal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

How to use Re-auth Modal

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