Skip to content

UV Index Dial

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

Weather & AmbientHTMLCSSany framework
7UV Index · High

Copy into your project

HTML
<!-- UV Index Dial (decorative half-circle gauge + a live numeric readout) -->
<div class="nuda-wa2-uv-dial">
  <div class="nuda-wa2-uv-dial__gauge" aria-hidden="true">
    <span class="nuda-wa2-uv-dial__arc"></span>
    <span class="nuda-wa2-uv-dial__needle"></span>
    <span class="nuda-wa2-uv-dial__hub"></span>
  </div>
  <div class="nuda-wa2-uv-dial__value">
    <strong>7</strong>
    <span>UV Index · High</span>
  </div>
</div>
CSS
.nuda-wa2-uv-dial {
  position: relative;
  width: 100%;
  max-width: 180px;
  height: 140px;
  border-radius: 14px;
  background: #111114;
  border: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  box-sizing: border-box;
}

.nuda-wa2-uv-dial__gauge {
  position: relative;
  width: 96px;
  height: 52px;
  overflow: hidden;
}

.nuda-wa2-uv-dial__arc {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(from 180deg,#22c55e 0deg,#e4ff54 90deg,#f59e0b 140deg,#ef4444 180deg,transparent 180deg);
  mask: radial-gradient(circle,transparent 60%,#000 61%);
  -webkit-mask: radial-gradient(circle,transparent 60%,#000 61%);
}

.nuda-wa2-uv-dial__needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 40px;
  margin-left: -1px;
  background: #fafafa;
  transform-origin: 50% 100%;
  transform: rotate(52deg);
  will-change: transform;
  animation: _nuda-wa2uvDialNeedle 6s ease-in-out infinite;
}

.nuda-wa2-uv-dial__hub {
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fafafa;
  transform: translateX(-50%);
}

.nuda-wa2-uv-dial__value {
  text-align: center;
  color: #fafafa;
  font: 600 12px/1.3 system-ui,sans-serif;
}

.nuda-wa2-uv-dial__value strong {
  display: block;
  font-size: 22px;
  color: #e4ff54;
}

.nuda-wa2-uv-dial__value span {
  display: block;
  font-size: 10px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .06em;
}

@keyframes _nuda-wa2uvDialNeedle {
  0%,100% {
    transform: rotate(48deg);
  }
  50% {
    transform: rotate(56deg);
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-wa2-uv-dial__needle {
    animation: none;
    transform: rotate(52deg);
  }
}

How to use UV Index Dial

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 weather & ambient components

← Browse all NudaUI components