Course contentsShow
← Web Development
Lesson 1715 of 2,98232. Server-Side Rendering ConceptsFree lesson

What is Client-Side Rendering (CSR)?

Understanding how traditional SPAs render content entirely in the browser using JavaScript.

What is Client-Side Rendering (CSR)?

You'll learn: How traditional Single Page Applications (SPAs) render content entirely in the browser using JavaScript.

The Core Concept

Client-Side Rendering (CSR) is an approach where your JavaScript application takes complete responsibility for building and updating the user interface in the browser. When a user visits your site, the server sends a minimal HTML shell—often just a <div id="root"></div>—along with your JavaScript bundle. The browser downloads and executes this JavaScript, which then dynamically creates and inserts all the visible content.

How It Works

Think of CSR like a restaurant that sends you raw ingredients and a recipe card. Instead of receiving a prepared meal (rendered HTML), you get the building blocks and instructions (JavaScript), and you prepare the meal yourself (render the UI) in your own kitchen (the browser).

In a typical CSR flow:

  1. Browser requests the page
  2. Server returns minimal HTML with <script> tags
  3. Browser downloads JavaScript bundles
  4. JavaScript executes and renders the entire UI
  5. Subsequent navigation happens without full page reloads

The SPA Connection

Modern frameworks like React, Vue, and Angular default to CSR when building SPAs. Your application fetches data through APIs (often triggering those network error messages and retry logic you've learned about), then updates the DOM directly. This creates fast, app-like experiences after the initial load—but users must wait for JavaScript to download and execute before seeing any content.

Key Takeaway: Client-Side Rendering puts the browser in charge of generating HTML from JavaScript, creating interactive SPAs but requiring users to wait for scripts to load before seeing content.