TanStack Start

Add PanelUI web components to a TanStack Start app.

For TanStack Start, with file-based routes.

A new project

Create the project

The shadcn CLI creates the app, sets up Tailwind CSS and writes the theme tokens in one go:

npx shadcn@latest init -t start

Add a component

npx shadcn@latest add https://panelui.dev/r/web/rolling-number.json

The source is written to components/panelui/rolling-number.tsx, and the packages it uses are installed for you.

Use it

src/routes/index.tsx
import { createFileRoute } from "@tanstack/react-router"
import { RollingNumber } from "@/components/panelui/rolling-number"

export const Route = createFileRoute("/")({ component: Home })

function Home() {
  return (
    <main className="flex min-h-svh items-center justify-center">
      <RollingNumber value={121} className="text-6xl font-semibold" />
    </main>
  )
}

An existing project

Run the CLI in the project. It adds the theme tokens to your CSS and writes components.json:

npx shadcn@latest init

Then add a component as in the steps above.

From npm

To install the package instead of copying source, follow From npm once the project has its shadcn theme.

On this page