page.js

A page is UI that is unique to a route.

app/blog/[slug]/page.tsx
export default function Page({ params, searchParams }: {
  params: { slug: string },
  searchParams: { id: string },
}) {
  return (
    <>
      <p>{params.slug}</p>
      <p>{searchParams.id}</p>
    </>
  );
}
  • params: (optional) The dynamic route params object from the root segment down that to that page.
  • searchParams: (optional) The URL search params object. E.g. acme.com/?q=cat{ q: "cat" }

Next Steps