Page searchParams
Search parameters are key-value pairs after the question mark in a URL. An App Router server page can read its searchParams prop to select the displayed data. Unlike path params, query values are optional and can repeat.
Scope: Next.js 16.x candidate, App Router only, Cache Components disabled, TypeScript unless otherwise labeled. Examples are static source walkthroughs; exact framework patch and build are not verified.
app/catalog/page.tsx (query preview)
type Query = Record<string, string | string[] | undefined>;export default async function Catalog({ searchParams }: { searchParams: Promise<Query>;}) { const query = await searchParams; const raw = query.tag; const tags = raw === undefined ? [] : Array.isArray(raw) ? raw : [raw]; return <main><h1>Catalog</h1><p>Tags: {tags.join(', ') || 'All'}</p></main>;}/catalog?tag=forest&tag=sea displays Tags: forest, sea. /catalog displays Tags: All. The example displays query values, not yet real filtering.
Distinguish absent, empty and repeated values
The page prop resolves to a plain object. A key can be absent, one string, or a string array. The empty string is distinct from absence even though the display above uses a human-friendly fallback. Query data is user input; validate it before using it. In this cache-components-disabled teaching lane reading the query is a request-time operation. Layouts do not get the same searchParams prop because shared layout reuse could make query information stale.
Query shapes (conceptual)
/catalog -> {}/catalog?tag= -> { tag: "" }/catalog?tag=forest -> { tag: "forest" }/catalog?tag=forest&tag=sea -> { tag: ["forest", "sea"] }Repeated keys need a policy. Multi-tag filtering may accept arrays; a single sort option may reject them. Never assume every query value is a string.
Common mistake
Do not call query.get("tag") on the awaited Page object. The client hook returns a different, URLSearchParams-like interface. Do not include secrets in URLs.
Try it yourself
Predict the value of tag for the four examples. Decide whether an empty tag should be rejected or treated as no filter, then document the policy.
After this lesson, you should be able to: Await query values; Distinguish repeated from absent query fields.