This template exists because the official shadcn/ui monorepo is built around a Next.js setup. While powerful, Next.js is primarily server-rendered, and sometimes you just want a lightweight, client-only solution—especially for static or cost-sensitive apps.
This template offers a Vite + React + shadcn/ui monorepo alternative. It lets you:
- Use shadcn/ui component architecture and styling conventions.
- Stick with client-side rendering (no SSR or backend infra).
- Save costs by deploying to static hosting providers (e.g., Vercel static, Netlify, Cloudflare Pages).
- Enjoy faster local dev and simpler deployments.
- Node.js (
>=20) - pnpm (version defined in
packageManagerfield)
# Clone the repository
git clone https://github.com/your-username/shadcn-vite-react-typescript-monorepo.git my-app
# Navigate to the project directory
cd my-app
# Install dependencies
pnpm install
# Start development server
pnpm dev├── apps/
│ └── web/ # Vite + React app
│ ├── public/
│ ├── src/
│ ├── components.json # shadcn/ui config
│ └── vite.config.ts
├── packages/
│ ├── ui/ # Shared shadcn/ui components
│ │ ├── components/ # UI components
│ │ ├── lib/ # Utilities (e.g., cn)
│ │ ├── styles/ # Global styles (globals.css)
│ │ └── components.json
│ ├── eslint-config/ # Shared ESLint config
│ └── typescript-config/ # Shared TypeScript config
├── pnpm-workspace.yaml # Monorepo workspace config
├── turbo.json # Turborepo pipeline config
└── package.json # Root config
- Monorepo: Managed with pnpm workspaces and Turborepo.
- Web App (
apps/web): Vite + React + TypeScript, styled with Tailwind CSS. - UI Package (
packages/ui): Shared components, styles, and utils. - Centralized Configs: Shared ESLint and TypeScript setups.
- shadcn/ui Integration: Easily share and reuse components across the monorepo.
You can add components using either of the following methods:
pnpm dlx shadcn@latest add <component> -c apps/webExample:
pnpm dlx shadcn@latest add button -c apps/webOption 2: From Inside the App Directory (Follow Official Guide)
cd apps/web
npx shadcn@latest add <component>Example:
cd apps/web
npx shadcn@latest add buttonThis:
- Uses
apps/web/components.jsonfor config. - Adds components to
packages/ui/src/components. - Updates
packages/ui/package.jsonwith required deps.
Aliases like "ui" and "utils" in components.json ensure shared usage via @workspace/ui.
import { Button } from "@workspace/ui/components/button";
function App() {
return <Button>Click Me</Button>;
}Build all packages:
pnpm buildRuns build scripts via Turborepo, including Vite build for the web app.
Run lint across all packages:
pnpm lintUses the lint scripts in each package (e.g., apps/web, packages/ui).
-
Project Info:
- Update
nameanddescriptionin allpackage.jsonfiles. - Edit browser tab title (
apps/web/index.html). - Replace logos/favicons (
apps/web/public/).
- Update
-
Styling:
- Define brand colors (
packages/ui/tailwind.config.mjs). - Customize global styles (
globals.css). - Extend or adapt UI components.
- Define brand colors (
-
Docs:
- Update this
README.md. - Add contributing guidelines (if needed).
- Document architecture or decisions.
- Update this
-
Cleanup:
- Remove unused example code/components (e.g.,
App.tsx).
- Remove unused example code/components (e.g.,
MIT
