Installation
One command. Zero config. Start building in seconds.
Magic Installation
RecommendedEverything you need in one command
# 🪄 Magic Installation - Everything in one command
ng add @ng-cn/core --theme=github --components=all
# Or with different themes
ng add @ng-cn/core --theme=vercel --components=all
ng add @ng-cn/core --theme=apple --components=allQuick Start
Set up core utilities, add components as needed
# Basic setup without components
ng add @ng-cn/core
# Or with a specific theme
ng add @ng-cn/core --theme=linear Then add components individually with ng g @ng-cn/core:c <name>
Available Themes
Choose your design language
Default clean, minimal design
--theme=shadcnDeveloper-focused aesthetic
--theme=githubBold black and white
--theme=vercelElegant, sophisticated
--theme=appleModern tech-forward
--theme=openaiVibrant, colorful
--theme=clickupSleek, minimal
--theme=linear# Available theme options
ng add @ng-cn/core --theme=shadcn # Default minimal theme
ng add @ng-cn/core --theme=github # GitHub's design language
ng add @ng-cn/core --theme=vercel # Bold black & white
ng add @ng-cn/core --theme=apple # Elegant Apple style
ng add @ng-cn/core --theme=openai # Modern tech aesthetic
ng add @ng-cn/core --theme=clickup # Vibrant colors
ng add @ng-cn/core --theme=linear # Sleek minimalWhat's in the Box
Everything included with the magic install
Dependencies Installed
tailwindcss^4.1.18@tailwindcss/postcss^4.1.18@angular/cdk^21.0.5lucide-angular^0.562.0class-variance-authority^0.7.1clsx^2.1.1tailwind-merge^3.4.0Utility Functions
cn()Tailwind CSS class merging utility with conflict resolution
Animation utilitiesSmooth transitions with AnimatedDirective, PresenceComponent
Accessibility utilitiesFocusTrap, KeyboardNavigation, LiveRegion directives
Positioning utilitiesSmart overlay positioning for popovers & dropdowns
Project Structure
Files added to your project
your-project/
├── postcss.config.mjs # Tailwind CSS v4 PostCSS config
├── tsconfig.json # Updated with path aliases
├── src/
│ ├── ng-cn.scss # Theme CSS variables & base styles
│ ├── styles.scss # Auto-imports ng-cn.scss
│ └── app/
│ └── lib/
│ ├── utils/
│ │ ├── cn.ts # Class merging utility
│ │ ├── index.ts # Utils barrel export
│ │ ├── animation/ # Animation utilities
│ │ │ ├── animated.directive.ts
│ │ │ ├── presence.component.ts
│ │ │ └── animation-tokens.service.ts
│ │ ├── accessibility/ # A11y utilities
│ │ │ ├── focus-trap.directive.ts
│ │ │ ├── keyboard-navigation.directive.ts
│ │ │ ├── live-region.directive.ts
│ │ │ └── visually-hidden.component.ts
│ │ └── positioning/ # Overlay positioning
│ └── components/
│ └── ui/ # Your components
│ ├── button/
│ ├── card/
│ ├── dialog/
│ └── ... (56+ with --components=all)ng-cn.scssTheme CSS variables with light/dark mode support, base styles, and animation keyframes
postcss.config.mjsPostCSS configuration for Tailwind CSS v4
lib/utils/cn.tsClass merging utility combining clsx and tailwind-merge
lib/utils/animation/Animation utilities including AnimatedDirective and PresenceComponent
lib/utils/accessibility/A11y utilities: FocusTrap, KeyboardNavigation, LiveRegion, VisuallyHidden
lib/utils/positioning/Smart overlay positioning for popovers, tooltips, and dropdowns
lib/components/ui/All UI components when using --components=all
Add Components
Install components one at a time
# Add individual components
ng g @ng-cn/core:c button
ng g @ng-cn/core:c card
ng g @ng-cn/core:c dialog
# Short alias
ng g @ng-cn/core:c input
ng g @ng-cn/core:c select
ng g @ng-cn/core:c tabsPopular components:
buttoncarddialoginputselectcheckboxtabstabletoastdropdown-menuformsidebarcommandcalendarand 40+ more...All Available Components
56+ components included with --components=all
Form Controls
buttoncheckboxinputinput-otplabelradio-groupselectsliderswitchtextareatoggletoggle-groupformData Display
avatarbadgecalendarcardcarouselchartprogressskeletontabledata-tableFeedback
alertalert-dialogdialogdrawersheettoasttooltipspinnerNavigation
breadcrumbcommanddropdown-menucontext-menumenubarnavigation-menupaginationsidebartabsLayout
accordionaspect-ratiocollapsibleresizablescroll-areaseparatorOverlay
popoverhover-cardcomboboxdate-pickerManual Setup
For those who prefer full control
Install dependencies
npm install clsx tailwind-merge class-variance-authority @angular/cdk lucide-angular tailwindcss @tailwindcss/postcssCreate PostCSS config for Tailwind v4
Create postcss.config.mjs:
/** @type {import('postcss').Config} */
export default {
plugins: {
'@tailwindcss/postcss': {},
},
};Create the cn utility
Create src/app/lib/utils/cn.ts:
import { clsx, type ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
/**
* Merge Tailwind classes with proper conflict resolution.
* @example cn('px-4 py-2', 'px-6') // => 'py-2 px-6'
*/
export function cn(...inputs: ClassValue[]): string {
return twMerge(clsx(inputs));
}Add CSS variables
Create src/ng-cn.scss and import in your styles:
@use "tailwindcss";
@custom-variant dark (&:is(.dark *));
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--border: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
/* ... more variables */
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
/* ... dark mode overrides */
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
/* ... theme mappings */
}
@layer base {
* { @apply border-border outline-ring/50; }
body { @apply bg-background text-foreground; }
}Configure path aliases
Add to tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@/lib/*": ["src/app/lib/*"],
"@/ui/*": ["src/app/lib/components/ui/*"],
"@/utils/*": ["src/app/lib/utils/*"]
}
}
}You're ready!
Start building beautiful, accessible UIs with shadcn-angular.