rosen

Guide

Next.js RSC Charts Without use client

Start server-first. Keep the chart render path in a Server Component, and move only interaction-specific behavior to small client wrappers.

Implementation Pattern

  1. Fetch data in a Server Component route or loader.
  2. Render the chart component directly on the server.
  3. Add client wrappers only for hover/tooltips/gestures when required.
  4. Preserve stable chart dimensions to avoid layout shifts.

Example

// app/dashboard/page.tsx (Server Component)
import { BarChartHorizontal } from "@/components/charts/bar/examples/BarChartHorizontal";

export default async function DashboardPage() {
  const data = await fetchData();
  return <BarChartHorizontal data={data} />;
}

Open QuickstartAdd Tooltips Next