Skip to content
GitHub

Vite

Install Shark UI in a Vite project.

Create project

Create a new Vite project:

Add Tailwind CSS

Create a file styles/globals.css with:

styles/globals.css

Edit tsconfig.json

Vite splits TypeScript config across multiple files. Add baseUrl and paths to the compilerOptions in both tsconfig.json and tsconfig.app.json:

TypeScripttsconfig.json

Edit tsconfig.app.json

Add the same path resolution so your IDE resolves imports correctly:

TypeScripttsconfig.app.json

Update vite.config.ts

Add the path alias so Vite resolves @/ at build time:

TypeScriptvite.config.ts

Run the CLI

Run the shadcn init command to set up your project:

The CLI creates a components.json file. When asked for base color, choose Neutral to match Shark UI defaults.

Add components

Add components from the Shark registry:

Import and use them:

TypeScriptsrc/App.tsx