Back to blogs

Build a Next.js Dashboard with PaceUI Blocks

Build a Next.js dashboard with a PaceUI stat card and campaign overview, then adapt the copied source for your own data, responsive layout, and product states.

Next.js

PaceUI

You can build a useful first dashboard screen by combining a metric card with a larger campaign overview. This tutorial installs two PaceUI blocks in a Next.js app, renders them on a page, and shows what to change before connecting the interface to real product data.

PaceUI installs block source into your project through the shadcn CLI. The files become part of your codebase, so you can adjust their markup and styles. The example blocks are free; check each item page for its current access and dependency details.

1. Register the PaceUI registry

In the components.json at your project root, add the PaceUI registry URL. Keep your existing aliases and other configuration:

components.json
{
  "registries": {
    "@paceui": "https://paceui.com/r/{name}.json"
  }
}

For Pro blocks, use the authenticated registry configuration in the installation guide. The free blocks in this tutorial do not need a PaceUI token.

2. Install the dashboard blocks

Run these commands from your Next.js project directory:

Terminal
npx shadcn@latest add @paceui/dashboard-stat-3
npx shadcn@latest add @paceui/app-analytics-4

The CLI adds the source and declared dependencies to your project. See the stat card and campaign overview pages for previews, code, and block-specific requirements.

3. Compose the dashboard page

For an App Router project, use a page such as app/dashboard/page.tsx:

page.tsx
import { Analytics4 } from "@/components/blocks/app/analytics/analytics-4";
import { Stat3 } from "@/components/blocks/dashboard/stat/stat-3";

export default function DashboardPage() {
return (
  <main className="mx-auto grid w-full max-w-6xl gap-6 p-6">
    <h1 className="text-2xl font-semibold">Dashboard</h1>

    <section aria-label="Monthly revenue" className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
      <Stat3
        title="Monthly revenue"
        value="$24,680"
        growthValue={8.2}
        timeText="from last month"
      />
    </section>

    <section aria-label="Campaign overview">
      <Analytics4 />
    </section>
  </main>
);
}

The metric is sample content. Replace it with a value from your app before using the page to report real revenue. The campaign overview also starts with example campaign names and progress values; update its installed source to reflect your product.

4. Make the layout fit your product

The example places a page title first, a metric row second, and the campaign overview below. Adapt that hierarchy to the question your users need to answer. For an operations dashboard, a system health summary may belong above revenue. For a marketing dashboard, campaign performance may deserve the most space.

The grid uses one column on small screens, two from the sm breakpoint, and four from lg. Check the installed blocks at those widths too. If a card contains a chart or long label, confirm that the content remains readable and that horizontal scrolling is not introduced by the block.

5. Connect real data and states

Before shipping, replace every example value and make the page reflect the states of your own data request:

  • Loading: show that the dashboard is fetching data without presenting sample values as current metrics.
  • No data: explain why the panel is empty and what the user can do next.
  • Error: provide a recovery action and avoid showing stale data as live.
  • Updated data: label the reporting period and comparison window so users understand what each number means.

These are application-level decisions. The installed block source gives you a starting UI; connect it to your own server data and state handling.

6. Customize the copied source

Open the installed files in your project to change labels, props, spacing, colors, or markup. Keep the block as a reusable component if you expect to use it in several places. For a one-off screen, you can simplify it to match your product's existing component structure.

If the CLI reports a missing dependency, check the block page and the install output before changing your package setup. Each PaceUI item has its own requirements.

Continue building