Install Next.js
Nexus UI components are written for the Next.js App Router with TypeScript and Tailwind CSS. This page explains the one command that creates that project. The Quick Start already includes it.
Requirements
- Node.js 20.9 or newer. Check with
node -v. - A package manager: npm (it comes with Node.js), pnpm, yarn or bun.
Create a new project
Run this in the folder where you keep your projects. my-app is the name of the new folder; use any name you like.
npx create-next-app@latest my-app --ts --tailwind --eslint --app --src-dir --import-alias "@/*" --yesWhat each flag does:
--tsuses TypeScript.--tailwindinstalls Tailwind CSS (version 4) and imports it insrc/app/globals.css.--eslintadds linting.--appuses the App Router, with pages insrc/app.--src-dirputs your code in asrc/folder. The paths in these docs, such assrc/componentsandsrc/lib, assume it.--import-alias "@/*"makes@/meansrc/, which is how Nexus UI components import each other.--yesaccepts the defaults for everything else, so it asks no questions. Leave it off to answer the prompts yourself.
The command also installs the packages, so you do not run npm install yourself.
Run the dev server
cd my-app
npm run devOpen http://localhost:3000; you should see the Next.js starter page. Press Ctrl+C in the terminal to stop it. Next, check Tailwind CSS or go straight back to the Quick Start.