Skip to content

Hourglass

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

LoadersHTMLCSSany framework

Copy into your project

HTML
<!-- Hourglass Loader -->
<div class="nuda-hourglass" role="status" aria-label="Loading">
  <div class="nuda-hourglass__shape"></div>
</div>
CSS
/* Hourglass Loader
   Rotating hourglass shape using CSS triangles.
   Customize: --hourglass-color, --hourglass-size */

.nuda-hourglass {
  --hourglass-color: #fbbf24;
  --hourglass-size: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nuda-hourglass__shape {
  width: calc(var(--hourglass-size) * 2);
  height: calc(var(--hourglass-size) * 3);
  position: relative;
  animation: nuda-hourglass 2s ease-in-out infinite;
  will-change: transform;
}

.nuda-hourglass__shape::before,
.nuda-hourglass__shape::after {
  content: '';
  position: absolute;
  left: 0;
  width: 0;
  height: 0;
  border-left: var(--hourglass-size) solid transparent;
  border-right: var(--hourglass-size) solid transparent;
}

.nuda-hourglass__shape::before {
  top: 0;
  border-top: calc(var(--hourglass-size) * 1.33) solid var(--hourglass-color);
}

.nuda-hourglass__shape::after {
  bottom: 0;
  border-bottom: calc(var(--hourglass-size) * 1.33) solid var(--hourglass-color);
}

@keyframes nuda-hourglass {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

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

How to use Hourglass

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 loaders components

← Browse all NudaUI components