Skip to content

Story Ring Avatar

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

AvatarsHTMLCSSany framework
N

Copy into your project

HTML
<!-- set data-seen="true" once the story has been viewed -->
<div class="nuda-av2-story" data-seen="false" aria-label="New story from Nia">
  <span class="nuda-av2-story__ring" aria-hidden="true"></span>
  <span class="nuda-av2-story__avatar" style="background:linear-gradient(135deg,#ffb45e,#ff6dd4)">N</span>
</div>
CSS
.nuda-av2-story {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
}

.nuda-av2-story__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,#e4ff54,#62b6ff,#ec4899,#e4ff54);
  animation: _nuda-av2storyspin 3s linear infinite;
  will-change: transform;
}

.nuda-av2-story[data-seen="true"] .nuda-av2-story__ring {
  background: #3a3a3a;
  animation: none;
}

.nuda-av2-story__avatar {
  position: relative;
  z-index: 1;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  font-weight: 700;
  font-size: 16px;
  border: 3px solid #09090b;
}

@keyframes _nuda-av2storyspin {
  to {
    transform: rotate(360deg);
  }
}

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

How to use Story Ring Avatar

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

← Browse all NudaUI components