Open this example in the interactive library
Source code
// components/ProductVariantRouteLinks.tsx
import Link from "next/link";
export default function ProductVariantRouteLinks({
slug = "desk-lamp",
}: { slug?: string } = {}) {
return (
<nav aria-label="Finish">
{["copper", "black"].map((f) => (
<Link
key={f}
href={{
pathname: "/products/" + encodeURIComponent(slug),
query: { finish: f },
}}
scroll={false}
>
{f}{" "}
</Link>
))}
</nav>
);
}
