Next.js
Step-by-Step configuration for Next.js
Initialize a NextJS Project
If you donβt already have a Next.js project set up, you can follow the official Next.js setup guide to create a new project quickly.
Make sure you have Tailwind CSS v4 installed
Follow these instructions if you don't have Tailwind CSS v4 installed in your project. You just need to have a globals.css
file. Note: Tailwind CSS v4 doesn't require a config file by default.
Add AlignUI Styles
Note: The above code includes the complete AlignUI design system with colors, typography, shadows, animations, and dark mode support. You can also get this CSS content by running the CLI command.
That's all! Now you have all AlignUI tokens.
Add the required utils
- Go to cn page and setup the utility in your project.
- Go to tv page and setup the utility in your project.
- Go to recursiveCloneChildren page and setup the utility in your project.
- Go to Polymorphic page and setup the utility in your project.
Add the icon library
AlignUI uses Remix Icon.
npm install @remixicon/react
Setup Inter font
Include Inter font from 'next/font/google'
:
Note for Tailwind CSS v4: Font configuration is handled via CSS variables in the @theme
block, so no additional config file setup is needed.
Add Dark Mode (Optional)
All you need to do to enable dark mode in your app is add the dark
class to your root element.
Note: With Tailwind CSS v4, dark mode classes are automatically included when using our @theme
configuration.
I recommend next-themes package for an easy dark mode toggle in your app.
That's all!
Now you can start adding components to your app. You can begin by adding a button first.