Next.js
Install and configure Glass UI in a Next.js project.
Installation
Create a new project
Start by creating a fresh Next.js application. If you already have a project, you can skip this step.
npx create-next-app@latestWe recommend accepting the default prompts so Next.js automatically configures Tailwind CSS, the App Router, and the @/* import alias for you.
If you prefer a src/ directory, add the --src-dir flag:
npx create-next-app@latest --src-dirVerify Configuration
If you created your project using the recommended defaults above, you can safely skip this step.
For existing or custom Next.js setups, ensure you have Tailwind CSS configured first. Then, verify that your tsconfig.json includes the @/* path alias:
If your project uses a src/ directory, make sure the alias points to ["./src/*"] instead.
Run the CLI
Run the init command to set up your configuration, base utilities, and global styles.
npx @glass-ui-kit/cli@latest initAdd your first component
You can now start adding glassmorphism components to your project. Let’s add the Card component:
npx @glass-ui-kit/cli@latest add cardUse the component
Replace the contents of your app/page.tsx with the following code to see Glass UI in action:
If you are using a src/ directory, the file will be located at src/app/page.tsx instead.