Installation
Set up Ndop UI in an Angular CLI, Nx or Analog app, then add your first component.
Ndop works in standalone Angular 21 and 22 apps with an app.config.ts.
In Angular CLI workspaces, ndop init sets everything up, including
Tailwind CSS v4 if your app doesn't have it yet.
Angular CLI
Create an app, or use an existing one:
npx @angular/cli new my-app --style tailwindpnpm dlx @angular/cli new my-app --style tailwindyarn dlx @angular/cli new my-app --style tailwindbunx @angular/cli new my-app --style tailwindMove into its folder:
cd my-appSet it up for Ndop:
npx @ndop/cli initpnpm dlx @ndop/cli inityarn dlx @ndop/cli initbunx @ndop/cli initThen add a component:
npx @ndop/cli add dialogpnpm dlx @ndop/cli add dialogyarn dlx @ndop/cli add dialogbunx @ndop/cli add dialogndop init asks before it changes anything. Pass --yes to skip the
question, or --dry-run to see every change as a diff first.
ndop init also adds @ndop/cli to your dev dependencies, so later
commands can run your project's own copy, at the version your lockfile
pins: npx ndop add dialog, or pnpm exec ndop add dialog. Pass
--no-cli to leave it out; see CLI.
Nx and Analog
ndop init reads angular.json, so it sets up Angular CLI workspaces only
for now. Nx and Analog apps can use Ndop with a few manual steps, after
which ndop add works as usual. Run every command from the workspace root.
Write
ndop.jsonAt the root, pointing at your app's folders:
ndop.json{ "$schema": "https://ndop.dev/schema/config.json", "style": "default", "tailwind": { "css": "apps/my-app/src/styles.css" }, "aliases": { "ui": "apps/my-app/src/app/ui", "lib": "apps/my-app/src/app/lib", "blocks": "apps/my-app/src/app/blocks" }, "importAlias": "@/", "iconLibrary": "lucide" }Import Tailwind CSS and Ndop's styles
The stylesheet needs Tailwind CSS v4 and Ndop's token mechanics:
apps/my-app/src/styles.css@import 'tailwindcss'; @import '@ndop/core/styles.css';Add the theme and the helper files
npx @ndop/cli add default utils iconspnpm dlx @ndop/cli add default utils iconsyarn dlx @ndop/cli add default utils iconsbunx @ndop/cli add default utils iconsRegister Ndop and the icons
In the app's
app.config.ts:apps/my-app/src/app/app.config.tsimport { ApplicationConfig } from '@angular/core'; import { provideNdop } from '@ndop/core'; import { provideIcons } from '@/lib/icons'; export const appConfig: ApplicationConfig = { providers: [provideNdop(), provideIcons()], };
Without an @/* path alias in the root tsconfig.json, ndop add rewrites
each component's @/ imports to relative paths.
What init changes
ndop init makes these changes, and running it again changes nothing:
- writes
ndop.json, which records where components go; - adds the
@/*path alias totsconfig.json, keeping its comments; - sets up Tailwind CSS v4, if needed;
- imports
@ndop/core/styles.cssand the default theme's tokens into your global stylesheet; - adds
src/app/lib/utils.tsandsrc/app/lib/icons.ts; - registers
provideNdop()andprovideIcons()inapp.config.ts; - installs
@ndop/coreand the theme's fonts with your package manager, and@ndop/clias a dev dependency unless you pass--no-cli.
Your first component
After ndop add dialog, import the parts you need from the file it wrote:
import { Component } from '@angular/core';
import { DialogContent, DialogTitle, Dialog, DialogPortal, DialogTrigger } from '@/ui/dialog/dialog';Every component page shows complete, tested examples.