Skip to content
Plotcnbeta
DocsChartsBlocksPlaygroundThemesExamples
Get started
Guide
  • Introduction
  • System Design
  • Engine Strategy
  • Installation
  • Project Setup
  • shadcn/ui Setup
  • Plotcn Registry
Fundamentals
  • Usage
  • Theming
  • Accessibility
  • Motion & Animation
  • Performance
  • TypeScript & I18n
Google Charts
  • Google Charts
  • Google GeoChart
Interactive Setup

Installation

Set up Plotcn for your stack. Choose your framework and package manager. Plotcn will show only the commands and configuration required for your project.

STEP 01Framework
STEP 02shadcn/ui
STEP 03Plotcn Registry
STEP 04First Chart

Choose your framework

Select your application framework to configure tailored scaffolding and setup commands.

Package manager— select to switch commands
Your configuration:Next.js+pnpm
TypeScript·Tailwind CSS·shadcn/ui

Requirements

Ensure your environment satisfies the requirements for your selected framework before proceeding:

  • Node.js 18.18.0 or newer (Node 20+ LTS recommended)
  • Next.js 14, 15, or 16 with App Router
  • Tailwind CSS v4 or v3 with CSS variables
  • TypeScript enabled
Plotcn is built natively for Next.js with React Server Component and client boundary support.

Create your project

Scaffold a clean project configured with your framework, TypeScript, Tailwind CSS, and shadcn/ui:

Run the initialization command below to scaffold your Next.js project configured with TypeScript, Tailwind CSS, and shadcn/ui:

Next.js scaffold (pnpm)
pnpm dlx shadcn@latest init --template next
Automatically configures Next.js App Router, Tailwind CSS, TypeScript, and shadcn/ui.

Initialize shadcn/ui

Plotcn visualizations are native React components designed around the shadcn/ui architecture. Initialize shadcn in your project:

If you already have an existing project and only need to initialize shadcn/ui, execute:

shadcn/ui init (pnpm)
pnpm dlx shadcn@latest init
Generates components.json and configures CSS theme variables.
Recommended setup preferences:
StyleDefault or Nova
Base ColorZinc or Neutral
CSS VariablesYes (required)

Configure Plotcn

Plotcn distributes copy-paste visualizations through the open shadcn registry specification. Add the Plotcn registry to your project configuration:

Plotcn follows shadcn/ui's open registry specification. Add the Plotcn registry to your components.json file under the registries property:

components.json
{ "$schema": "https://ui.shadcn.com/schema.json", "style": "default", "rsc": true, "tsx": true, "tailwind": { "css": "app/globals.css", "baseColor": "neutral", "cssVariables": true }, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui" }, "registries": { "@plotcn": "https://plotcn.vercel.app/r/{name}.json" } }
During local development or preview testing, you can also add components directly by registry URL: shadcn add https://plotcn.vercel.app/r/line.json

Install your first visualization

Add your first visualization component directly into your project's components/charts directory:

Install the interactive Cartesian line chart into your codebase:Engine: Recharts
Install Line Chart (pnpm)
pnpm dlx shadcn@latest add @plotcn/line
Copies source to components/charts/line.tsx with full code ownership.

Verify your setup

Ensure your project resolves Plotcn components, dependencies, and theme CSS variables properly:

Verify that the component renders and resolves theme tokens in your page:

app/page.tsx (or component)
import { PlotLineChart } from "@/components/charts/plot-line-chart" const data = [ { label: "Jan", value: 1200 }, { label: "Feb", value: 1800 }, { label: "Mar", value: 2600 }, ] export function OverviewChart() { return ( <div className="h-[280px] w-full"> <PlotLineChart data={data} label="Sessions" /> </div> ) }
Verification Checklist
Component source copied to components/charts/plot-line-chart.tsx
Visualization engine (Recharts / D3) dependency installed
Chart responds to system theme tokens (--plot-grid, --plot-surface)
TypeScript compiles cleanly without any errors

Next steps

Explore the core concepts and customize Plotcn visualizations for your product:

  • Project Setup — Verify path aliases and Tailwind CSS configuration.
  • shadcn Setup — Deep-dive into components.json options.
  • Theming — Customize Cartesian and geometric chart color tokens.
  • Usage Guide — Learn the standard component API and props pattern.
PreviousEngine StrategyNextProject Setup

On this page

  • Choose your framework
  • Requirements
  • Create your project
  • Initialize shadcn/ui
  • Configure Plotcn
  • Install your first visualization
  • Verify your setup
  • Next steps