Marching Ants
A copy-paste borders & outlines component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Borders & OutlinesHTMLCSSany framework
Marching Ants
Copy into your project
HTML
<div class="nuda-dmb-border">
<svg class="nuda-dmb-border__svg" viewBox="0 0 200 80" fill="none" preserveAspectRatio="none" aria-hidden="true">
<rect class="nuda-dmb-border__rect" x="2" y="2" width="196" height="76" rx="10"
stroke="#e4ff54" stroke-width="2" pathLength="100" />
</svg>
<span class="nuda-dmb-border__label">Marching Ants</span>
</div>CSS
.nuda-dmb-border {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
background: #1a1a1a;
border-radius: 10px;
padding: 22px 36px;
min-width: 160px;
}
.nuda-dmb-border__svg {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.nuda-dmb-border__rect {
stroke-dasharray: 4 4;
animation: _nuda-dmbMarch 1s linear infinite;
}
.nuda-dmb-border__label {
color: #cfcfcf;
font-size: .85rem;
position: relative;
}
@keyframes _nuda-dmbMarch {
to {
stroke-dashoffset: -8;
}
}
@media (prefers-reduced-motion:reduce) {
.nuda-dmb-border__rect {
animation: none;
}
}
How to use Marching Ants
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.