Skip to content

Installation

TanStack Start

Install newt/ui in a TanStack Start app: the root route stylesheet, the alias, and the two commands.

Choose the brand hue, the radius and the font in newt/create, and it prints a preset code. Pass that code to init and the project comes out already wearing it.

npx create-tsrouter-app@latestpnpm dlx create-tsrouter-app@latestyarn dlx create-tsrouter-app@latestbunx create-tsrouter-app@latestdeno run -A npm:create-tsrouter-app@latestvlx create-tsrouter-app@latestvp dlx create-tsrouter-app@latestnubx create-tsrouter-app@latestnlx create-tsrouter-app@latestupx create-tsrouter-app@latest
npx newtui@latest init --preset <code>pnpm dlx newtui@latest init --preset <code>yarn dlx newtui@latest init --preset <code>bunx newtui@latest init --preset <code>deno run -A npm:newtui@latest init --preset <code>vlx newtui@latest init --preset <code>vp dlx newtui@latest init --preset <code>nubx newtui@latest init --preset <code>nlx newtui@latest init --preset <code>upx newtui@latest init --preset <code>
npx newtui@latest add buttonnpx shadcn@latest add @newtui/buttonnpx shadcn-vue@latest add @newtui/buttonpnpm dlx newtui@latest add buttonpnpm dlx shadcn@latest add @newtui/buttonpnpm dlx shadcn-vue@latest add @newtui/buttonyarn dlx newtui@latest add buttonyarn dlx shadcn@latest add @newtui/buttonyarn dlx shadcn-vue@latest add @newtui/buttonbunx newtui@latest add buttonbunx shadcn@latest add @newtui/buttonbunx shadcn-vue@latest add @newtui/buttondeno run -A npm:newtui@latest add buttondeno run -A npm:shadcn@latest add @newtui/buttondeno run -A npm:shadcn-vue@latest add @newtui/buttonvlx newtui@latest add buttonvlx shadcn@latest add @newtui/buttonvlx shadcn-vue@latest add @newtui/buttonvp dlx newtui@latest add buttonvp dlx shadcn@latest add @newtui/buttonvp dlx shadcn-vue@latest add @newtui/buttonnubx newtui@latest add buttonnubx shadcn@latest add @newtui/buttonnubx shadcn-vue@latest add @newtui/buttonnlx newtui@latest add buttonnlx shadcn@latest add @newtui/buttonnlx shadcn-vue@latest add @newtui/buttonupx newtui@latest add buttonupx shadcn@latest add @newtui/buttonupx shadcn-vue@latest add @newtui/button

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

TanStack Start has no scaffold template, so the project is created by its own tool first and init runs inside the result. It detects the framework, the bundler and the stylesheet on its own.

npx create-tsrouter-app@latestpnpm dlx create-tsrouter-app@latestyarn dlx create-tsrouter-app@latestbunx create-tsrouter-app@latestdeno run -A npm:create-tsrouter-app@latestvlx create-tsrouter-app@latestvp dlx create-tsrouter-app@latestnubx create-tsrouter-app@latestnlx create-tsrouter-app@latestupx create-tsrouter-app@latest
npx newtui@latest initpnpm dlx newtui@latest inityarn dlx newtui@latest initbunx newtui@latest initdeno run -A npm:newtui@latest initvlx newtui@latest initvp dlx newtui@latest initnubx newtui@latest initnlx newtui@latest initupx newtui@latest init
npx newtui@latest add buttonnpx shadcn@latest add @newtui/buttonnpx shadcn-vue@latest add @newtui/buttonpnpm dlx newtui@latest add buttonpnpm dlx shadcn@latest add @newtui/buttonpnpm dlx shadcn-vue@latest add @newtui/buttonyarn dlx newtui@latest add buttonyarn dlx shadcn@latest add @newtui/buttonyarn dlx shadcn-vue@latest add @newtui/buttonbunx newtui@latest add buttonbunx shadcn@latest add @newtui/buttonbunx shadcn-vue@latest add @newtui/buttondeno run -A npm:newtui@latest add buttondeno run -A npm:shadcn@latest add @newtui/buttondeno run -A npm:shadcn-vue@latest add @newtui/buttonvlx newtui@latest add buttonvlx shadcn@latest add @newtui/buttonvlx shadcn-vue@latest add @newtui/buttonvp dlx newtui@latest add buttonvp dlx shadcn@latest add @newtui/buttonvp dlx shadcn-vue@latest add @newtui/buttonnubx newtui@latest add buttonnubx shadcn@latest add @newtui/buttonnubx shadcn-vue@latest add @newtui/buttonnlx newtui@latest add buttonnlx shadcn@latest add @newtui/buttonnlx shadcn-vue@latest add @newtui/buttonupx newtui@latest add buttonupx shadcn@latest add @newtui/buttonupx shadcn-vue@latest add @newtui/button

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

Create the app

npx create-tsrouter-app@latest my-app --template file-router --tailwind

The template already carries Tailwind v4 through the Vite plugin. An app made without --tailwind needs tailwindcss and @tailwindcss/vite installed and the plugin added to vite.config.ts.

Declare the alias twice

{
  "compilerOptions": {
    "paths": { "@/*": ["./src/*"] }
  }
}
import { fileURLToPath } from "node:url"

import { defineConfig } from "vite"

export default defineConfig({
  resolve: {
    alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
  },
})

Run init

npx newtui@latest initpnpm dlx newtui@latest inityarn dlx newtui@latest initbunx newtui@latest initdeno run -A npm:newtui@latest initvlx newtui@latest initvp dlx newtui@latest initnubx newtui@latest initnlx newtui@latest initupx newtui@latest init

There is no --template for TanStack Start: the app is created by create-tsrouter-app above, and init reads what it finds — React from the dependencies, the stylesheet from src/styles.css.

Mark the root document

The root route owns the <body>, so .newt-root goes there:

import appCss from "../styles.css?url"

export const Route = createRootRoute({
  head: () => ({ links: [{ rel: "stylesheet", href: appCss }] }),
  component: () => (
    <html lang="en">
      <body className="newt-root">
        <Outlet />
      </body>
    </html>
  ),
})

Add a component

npx newtui@latest add buttonnpx shadcn@latest add @newtui/buttonnpx shadcn-vue@latest add @newtui/buttonpnpm dlx newtui@latest add buttonpnpm dlx shadcn@latest add @newtui/buttonpnpm dlx shadcn-vue@latest add @newtui/buttonyarn dlx newtui@latest add buttonyarn dlx shadcn@latest add @newtui/buttonyarn dlx shadcn-vue@latest add @newtui/buttonbunx newtui@latest add buttonbunx shadcn@latest add @newtui/buttonbunx shadcn-vue@latest add @newtui/buttondeno run -A npm:newtui@latest add buttondeno run -A npm:shadcn@latest add @newtui/buttondeno run -A npm:shadcn-vue@latest add @newtui/buttonvlx newtui@latest add buttonvlx shadcn@latest add @newtui/buttonvlx shadcn-vue@latest add @newtui/buttonvp dlx newtui@latest add buttonvp dlx shadcn@latest add @newtui/buttonvp dlx shadcn-vue@latest add @newtui/buttonnubx newtui@latest add buttonnubx shadcn@latest add @newtui/buttonnubx shadcn-vue@latest add @newtui/buttonnlx newtui@latest add buttonnlx shadcn@latest add @newtui/buttonnlx shadcn-vue@latest add @newtui/buttonupx newtui@latest add buttonupx shadcn@latest add @newtui/buttonupx shadcn-vue@latest add @newtui/button

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

import { Button } from "@/components/ui/button"

export const Route = createFileRoute("/")({
  component: () => <Button variant="primary">Send</Button>,
})

Server rendering

Start renders on the server by default, so the same rule as Next applies: the nine interactive components carry "use client". Answer yes to the React Server Components question at init to keep those directives, no to have add strip them.

What init writes

components.json                 the config, shared with shadcn
src/styles.css                  the --newt-* token block
src/lib/utils.ts                cn()
src/components/ui/button.tsx    add button

See Dark mode for the theme toggle, and RTL if the app has to run right to left.