CodPen.ir
BlogGuidePublic projectsPricing
Open editor
BlogGuidePublic projectsPricing
CodPen.ir/Blog/Next.js
Back to blog
Next.js#Next.js#Architecture

Essential Next.js and App Router capabilities

Understand Server and Client Components, routing, metadata, and loading UI through one practical mental model.

By CodPen.irPublished July 13, 20261 min read
Essential Next.js and App Router capabilities

Start with Server Components

In the App Router, components are server-rendered by default. Data access, metadata, and secrets stay at that boundary while browser interactions move into small client components.

Dynamic metadata on the server

export async function generateMetadata({ params }: Props) {
  const post = getPost((await params).slug);
  return { title: post.title };
}

Keep route UI close to the route

  • Use loading.tsx for route-level pending UI.
  • Call notFound() for an invalid slug.
  • Mark only interactive components with use client.

The server/client boundary is a performance and security decision, not just a syntax constraint.

On this page

Start with Server ComponentsKeep route UI close to the route

Related articles

Getting started with the CodPen online editor
Getting started1 min read

Getting started with the CodPen online editor

From choosing a template to creating files, using live preview, and saving your first project—a practical path into CodPen.

Read article
Build your first React project from scratch
React1 min read

Build your first React project from scratch

Build a small but realistic interface with components, props, and state while learning a clean React project structure.

Read article
JavaScript or TypeScript: which should you choose?
Programming languages1 min read

JavaScript or TypeScript: which should you choose?

Compare the practical tradeoffs in startup speed, maintenance, developer experience, and team size.

Read article
CodPen.ir

A browser workspace for learning, building, reviewing, and sharing front-end projects.

© 2026 CodPen.ir · All rights reserved.