- Docs
- Installation
- Next.js
Next.js
Install and configure Next.js.
Create project
Start by creating a new Next.js project using create-next-app:
You will be asked a few questions to create the project:
Currently, I prefer to use Biome.js instead of ESLint. You can use ESLint if you prefer.
Also I prefer to use ~ as the alias. You can use @ or any other alias if you prefer.
Run the shadcn CLI
Run the shadcn init command to setup your project:
Remove unused shadcn packages
Kanpeki uses modern tooling instead of shadcn's defaults. Remove packages you won't need:
Why? Kanpeki uses CVA beta and tailwindcss-motion instead. See the introduction for details.
Delete these files:
src/lib/utils.ts(optional - keep if you have other utilities)
Remove this import from src/styles/globals.css:
That's it ✨
You can now start adding components to your project.
The command above will add the Button component to your project. You can then import it like this:
Fonts (optional)
I use Geist as the default font. You can use any font you like.
Here's how I configure Geist for Next.js:
1. Create a fonts.ts file inside src/config:
2. Import the font in the root layout:
3. Configure --font-sans in globals.css
App structure
Here's how I structure my Next.js apps. You can use this as a reference:
- I place the UI components in the
src/components/uifolder. - The
libfolder contains configuration for external libraries. - The
stylesfolder contains the global CSS.