Nextjs Use Search Params Suspense

Pattern for using useSearchParams hook with Suspense boundary in Next.js. Covers the required combination of 'use client' directive and Suspense wrapper when accessing URL query parameters in client components. Use when building search interfaces, filters, pagination, or any feature that needs to read/manipulate URL query parameters client-side.

115 stars 22 forksFrontend & Design

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add wsimmonds/claude-nextjs-skills --skill nextjs-use-search-params-suspense
Manual install
git clone --depth 1 https://github.com/wsimmonds/claude-nextjs-skills.git /tmp/claude-nextjs-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-nextjs-skills/nextjs-use-search-params-suspense ~/.claude/skills/nextjs-use-search-params-suspense

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Next.js: useSearchParams with Suspense Pattern

## Pattern Overview

**The useSearchParams hook requires TWO things:**
1. Component must have `'use client'` directive
2. Component must be wrapped in a `<Suspense>` boundary

This is a Next.js requirement, not optional!

## Why This Pattern?

**useSearchParams** reads URL query parameters:
- `/search?q=shoes` → `searchParams.get('q')` returns `"shoes"`
- `/products?category=electronics&sort=price` → Read multiple params

**Why Suspense?**
Next.js uses React 18's Suspense to handle the async nature of reading URL params during server-side rendering and hydration.

## The Pattern

### Single-File Pattern (Recommended)

```typescript
// app/page.tsx
import { Suspense } from 'react';
import SearchComponent from './SearchComponent';

export default function Page() {
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <SearchComponent />
    </Suspense>
  );
}

// app/SearchComponent.tsx
'use client';

import { useSearchParams } from 'next/navigation';

export default function SearchComponent() {
  const searchParams = useSearchParams();
  const query = searchParams.get('q') || '';

  return (
    <div>
      <h1>Search Results for: {query}</h1>
    </div>
  );
}
```

### Inline Pattern (Single File)

Sometimes you want everything in one file:
Read the full skill on GitHub

Details

Skill name
nextjs-use-search-params-suspense
Path
nextjs-use-search-params-suspense/SKILL.md
License
MIT
Repo updated
24 October 2025

FAQ

What does the Nextjs Use Search Params Suspense skill do?

Pattern for using useSearchParams hook with Suspense boundary in Next.js. Covers the required combination of 'use client' directive and Suspense wrapper when accessing URL query parameters in client components. Use when building search interfaces, filters, pagination, or any feature that needs to read/manipulate URL query parameters client-side.

How do I install the Nextjs Use Search Params Suspense skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add wsimmonds/claude-nextjs-skills --skill nextjs-use-search-params-suspense. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Nextjs Use Search Params Suspense popular?

It lives in wsimmonds/claude-nextjs-skills, which has 115 GitHub stars and 22 forks.

Related skills

Nextjs Advanced Routing

115

wsimmonds/claude-nextjs-skills

Guide for advanced Next.js App Router patterns including Route Handlers, Parallel Routes, Intercepting Routes, Server Actions, error boundaries, draft mode, and streaming with Suspense. CRITICAL for server actions (action.ts, actions.ts files, 'use server' directive), setting cookies from client components, and form handling. Use when requirements involve server actions, form submissions, cookies, mutations, API routes, `route.ts`, parallel routes, intercepting routes, or streaming. Essential for separating server actions from client components.

Frontend & Design22

Nextjs Anti Patterns

115

wsimmonds/claude-nextjs-skills

Identify and fix common Next.js App Router anti-patterns and mistakes. Use when reviewing code for Next.js best practices, debugging performance issues, migrating from Pages Router patterns, or preventing common pitfalls. Activates for code review, performance optimization, or detecting inappropriate useEffect/useState usage. CRITICAL: For browser detection, keep the logic in the user-facing component (or a composed helper that it renders) rather than isolating it in unused files.

Frontend & Design22

Nextjs App Router Fundamentals

115

wsimmonds/claude-nextjs-skills

Guide for working with Next.js App Router (Next.js 13+). Use when migrating from Pages Router to App Router, creating layouts, implementing routing, handling metadata, or building Next.js 13+ applications. Activates for App Router migration, layout creation, routing patterns, or Next.js 13+ development tasks.

Frontend & Design22

Generate Brand Assets

115

crafter-station/skills

Generate OG images and favicon based on project branding. Use when: (1) user needs social media preview images for their project, (2) user wants to generate a favicon, (3) user is setting up branding assets for a website or app, (4) user has brand colors and wants professional-looking Open Graph images. Automatically generates correctly sized images optimized for social platforms (Twitter, LinkedIn, Facebook) and favicon formats.

Frontend & Design15

Nextjs Server Navigation

115

wsimmonds/claude-nextjs-skills

Guide for implementing navigation in Next.js Server Components using Link component and redirect() function. Covers the difference between server and client navigation methods. Use when adding links, redirects, or navigation logic in server components without converting them to client components unnecessarily.

Frontend & Design22

Algo Nlp Lda

248

asgard-ai-platform/skills

Implement LDA topic modeling to discover latent topics in document collections. Use this skill when the user needs to extract topics from a text corpus, categorize documents by theme, or explore thematic structure — even if they say 'what are the main topics', 'topic extraction', or 'document clustering by theme'.

Frontend & Design30

Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.