Open this example in the interactive library
Source code
"use client";
// components/ClientCollectionSiblings.tsx
import Link from "next/link";
import { useParams } from "next/navigation";
export default function ClientCollectionSiblings() {
const { collection } = useParams<{ collection: string }>();
return (
<nav>
<Link href={"/collections/" + encodeURIComponent(collection)}>Collection</Link> ·{" "}
<Link href={"/collections/" + encodeURIComponent(collection) + "/about"}>
About
</Link>
</nav>
);
}
