Zigzag Divider
A copy-paste dividers component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
DividersHTMLCSSany framework
Copy into your project
HTML
<svg class="nuda-zigzag-divider" viewBox="0 0 400 16" preserveAspectRatio="none"
role="separator" aria-hidden="true">
<polyline class="nuda-zigzag-divider__line"
points="0,8 20,2 40,14 60,2 80,14 100,2 120,14 140,2 160,14 180,2
200,14 220,2 240,14 260,2 280,14 300,2 320,14 340,2 360,14
380,2 400,8"
fill="none" stroke="currentColor" stroke-width="1.5"
stroke-linejoin="round" />
</svg>CSS
/* Zigzag Divider
Zigzag pattern that draws itself in.
Customize: --zigzag-color, --zigzag-opacity */
.nuda-zigzag-divider {
--zigzag-color: #e4ff54;
--zigzag-opacity: 0.4;
width: 100%;
height: 16px;
color: var(--zigzag-color);
opacity: var(--zigzag-opacity);
}
.nuda-zigzag-divider__line {
stroke-dasharray: 800;
stroke-dashoffset: 800;
animation: nuda-zigzag-draw 1.5s ease forwards;
}
@keyframes nuda-zigzag-draw {
to {
stroke-dashoffset: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.nuda-zigzag-divider__line {
animation: none;
stroke-dashoffset: 0;
}
}How to use Zigzag Divider
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.