Skip to content

Pull to Refresh

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

Mobile PatternsHTMLCSSany framework

Copy into your project

HTML
<div class="nuda-ptr">
  <div class="nuda-ptr__indicator" aria-hidden="true">
    <svg viewBox="0 0 24 24" width="20" height="20" fill="none">
      <circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="2"
        stroke-dasharray="44" stroke-dashoffset="11" stroke-linecap="round" />
    </svg>
  </div>
  <div class="nuda-ptr__list">
    <div class="nuda-ptr__row"></div>
    <div class="nuda-ptr__row"></div>
    <div class="nuda-ptr__row"></div>
  </div>
</div>
CSS
/* Pull to Refresh
   Spinning indicator above a list, simulates pull gesture.
   Customize: --ptr-color */

.nuda-ptr {
  --ptr-color: #e4ff54;
  position: relative;
  width: 280px;
  height: 200px;
  background: #0c0c10;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 48px;
}

.nuda-ptr__indicator {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ptr-color);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: nuda-ptr-spin 1.2s linear infinite;
}

.nuda-ptr__list {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nuda-ptr__row {
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes nuda-ptr-spin {
  to { transform: translateX(-50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nuda-ptr__indicator { animation: none; }
}

How to use Pull to Refresh

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 mobile patterns components

← Browse all NudaUI components