INTERACTION_082CSS
Liquid Hover Button
A rounded fill rises from the bottom edge and floods the button.
Buttons / LightView
The arrow exits right and re-enters from the left on hover. The arrow at rest, the duplicate off-canvas left before the trigger; translating both arrows right by their own width once hover or focus.
/* Arrow Morph Button — The arrow exits right and re-enters from the left on hover. */
.arrow-morph-button {
--dur: 420ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.arrow-morph-button > * {
opacity: 0;
transform: translateY(14px);
animation: arrow-morph-button-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* the arrow at rest, the duplicate off-canvas left -> translating both arrows right by their own width */
@keyframes arrow-morph-button-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.arrow-morph-button > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Arrow Morph Button — trigger: hover or focus */
export function ArrowMorphButton({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
el.dataset["state"] = "in";
return;
}
const io = new IntersectionObserver(
([entry]) => {
if (entry?.isIntersecting) {
el.dataset["state"] = "in";
io.unobserve(el);
}
},
{ threshold: 0.2 },
);
io.observe(el);
return () => io.disconnect();
}, []);
return (
<div ref={ref} className="arrow-morph-button" data-state="out">
{children}
</div>
);
}A rounded fill rises from the bottom edge and floods the button.
A soft glow tracks the pointer inside the button surface.
The label slides up and a duplicate takes its place.
A check mark draws itself once the action completes.