Skip to content
Learn Netverks

Lesson

Step 13/36 36% through track

client-components

Client Components

Last reviewed May 28, 2026 Content v20260528
Track mode
client_nextjs
Means
In-browser Next.js (client components)
Reading
~1 min
Level
beginner

This lesson

This lesson teaches Client Components: the concepts, APIs, and habits you need before advancing in Next.js.

Without Client Components, you will struggle to read or extend Next.js codebases and playground exercises.

You will apply Client Components in contexts like: Marketing sites, dashboards, e-commerce, and Vercel-style deployments that need hybrid static + dynamic pages.

Write TSX for Client Components, click Run—React 18 CDN + in-browser TSX compile; use client/server lessons explain App Router concepts; mountApp renders interactive UI; printOutput feeds the terminal.

When you can explain the previous lesson's ideas without copying starter code.

Client Components behave like classic React: they hydrate in the browser, use hooks, handle events, and access browser APIs. Any interactive UI—buttons, forms with instant validation, charts—lives here.

When you need the client

  • Event listeners (onClick, onChange)
  • State and lifecycle hooks
  • Browser APIs (geolocation, localStorage)
  • Effects that run only in the browser

Boundary rule

Push 'use client' as deep as possible—wrap only the interactive leaf, not the entire page. Server parents can render client children; keep data fetching on the server when you can.

Playground

The editor runs Client Component code directly. Write 'use client' like production code; the runner strips it so TSX executes in the iframe.

Self-check

  1. Why should most of a page stay a Server Component?
  2. Give one UI element that must be a Client Component.

Challenge

Interactive counter

  1. Click the button and confirm the count increases.
  2. Add a Reset button that sets count to 0.

Done when: counter increments and resets correctly in the preview.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • When must client?
  • Bundle size concern?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump