Dev Helpers
← Back

Client slug display

Place this file at components/ClientSlugDisplay.tsx in an App Router project. Mount inside a route with the named dynamic segments shown in useParams.

Open this example in the interactive library

Source code

"use client";

// components/ClientSlugDisplay.tsx

import { useParams } from "next/navigation";

export default function ClientSlugDisplay() {
  const { slug } = useParams<{ slug: string }>();
  return <code>{slug}</code>;
}