Shadcn.io is not affiliated with official shadcn/ui
TanStack Router
Install shadcn/ui in a TanStack Router SPA. create-tsrouter-app with Tailwind and the shadcn add-on, then add a component from the shadcn.io registry.
This is the SPA. Full-stack Start is TanStack Start. Official scaffold already turns on Tailwind and shadcn.
Create the project
npx create-tsrouter-app@latest my-app --template file-router --tailwind --add-ons shadcnAdd a component
npx shadcn@latest add https://www.shadcn.io/r/button.jsonimport { createFileRoute } from "@tanstack/react-router"
import { Button } from "@/components/ui/button"
export const Route = createFileRoute("/")({
component: App,
})
function App() {
return (
<div>
<Button>Click me</Button>
</div>
)
}Start vs Router
--add-ons shadcn is correct here. On TanStack Start, skip that add-on and run npx shadcn@latest init yourself.
Questions
Related
Was this page helpful?
Sign in to leave feedback.
TanStack Start
Install shadcn/ui in TanStack Start with the official CLI. File routes, then add a component from the shadcn.io registry. TypeScript and Tailwind CSS.
Gatsby
Install shadcn/ui in Gatsby with the official CLI. Tailwind v3, webpack aliases, then add a component from the shadcn.io registry.