Underline Grow
A copy-paste text effects component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
Text EffectsHTMLCSSany framework
Copy into your project
HTML
<!-- Underline Grow — underline grows on hover/focus -->
<a href="#" class="nuda-underline-grow">Hover me</a>CSS
/* ── Underline Grow ──────────────────────────────────────────
Underline scales in from the left on hover/focus.
Customize:
--nuda-ug-clr : underline color
--nuda-ug-thick : underline thickness
--nuda-ug-speed : grow duration
──────────────────────────────────────────────────────────── */
.nuda-underline-grow {
--nuda-ug-clr: #e4ff54;
--nuda-ug-thick: 2px;
--nuda-ug-speed: 0.32s;
position: relative;
display: inline-block;
font-size: 1.6rem;
font-weight: 700;
color: #fafafa;
text-decoration: none;
cursor: pointer;
}
.nuda-underline-grow::after {
content: '';
position: absolute;
left: 0;
bottom: -4px;
width: 100%;
height: var(--nuda-ug-thick);
background: var(--nuda-ug-clr);
transform: scaleX(0);
transform-origin: left center;
transition: transform var(--nuda-ug-speed) cubic-bezier(0.22, 1, 0.36, 1);
}
.nuda-underline-grow:hover::after,
.nuda-underline-grow:focus-visible::after {
transform: scaleX(1);
}
.nuda-underline-grow:focus-visible {
outline: 2px solid var(--nuda-ug-clr);
outline-offset: 4px;
}
/* ── Accessibility ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
.nuda-underline-grow::after {
transition: none;
}
}How to use Underline Grow
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.