Get started
Everything an Angular app needs for the components: Angular Aria and the CDK, Tailwind CSS, the utilities and the font, then the packages and your styles.css.
1. Install Angular Aria and CDK
Semantic Components depends on Angular Aria and Angular CDK.
2. Set up Tailwind CSS
Tailwind CSS v4 is required. Follow these steps if not already installed:
2.1 Install Tailwind CSS
Next, open a terminal in your Angular project's root directory and run the following command to install Tailwind CSS and its peer dependencies:
2.2 Configure PostCSS Plugins
Next, add a .postcssrc.json file in the file root of the project. Add the @tailwindcss/postcss plugin into your PostCSS configuration.
{ "plugins": { "@tailwindcss/postcss": {} }}3. Install utilities
Install the required utility libraries for class management and animations.
4. Install the font
The theme's font is Geist, as in shadcn/ui:
Your styles.css imports it (it's in the file to copy, step 8): @import '@fontsource-variable/geist';
5. Install icons
The examples use @semantic-icons/lucide-icons — install it to copy them as they are.
The components themselves draw no icons: they're in your templates, so you can swap them for any library.
6. Polyfill Temporal
The date components use the browser's Temporal API. Until every browser has it (Safari doesn't yet), add a polyfill to your app: it fills in the global only where it's missing.
Then list it in your build's polyfills (angular.json): "polyfills": ["temporal-polyfill/global"]. Once all browsers ship Temporal, remove both — your code stays as it is.
7. Install the packages
The components, and their classes in shadcn's styles (the styles):
8. Configure styles
As in shadcn/ui, the theme is your app's. Copy this into your styles.css: shadcn's nova theme (its CSS variables: colors, radius, fonts, charts, sidebar) with our additions marked "Not shadcn's", the library's styles, and the Tailwind sources.
@import url('@angular/cdk/a11y-prebuilt.css');@import url('@angular/cdk/overlay-prebuilt.css');@import 'tailwindcss';@import 'tw-animate-css';@import 'shadcn/tailwind.css';@import '@fontsource-variable/geist';@import '@semantic-components/styles/reduced-motion.css';@import '@semantic-components/styles/typeset.css';@import '@semantic-components/styles/nova/typeset-variables.css';@import '@semantic-components/styles/scrollbar.css';@import '@semantic-components/styles/nova/scrollbar-variables.css';
/* The library and your style (its file only): Tailwind skips node_modules. Adjust the path to node_modules to your project. */@source '../node_modules/@semantic-components/ui';@source '../node_modules/@semantic-components/styles/fesm2022/semantic-components-styles-nova.mjs';
/* * The theme: shadcn's nova, with our differences marked "Not shadcn's": * tokens of ours, two colors darkened for contrast (WCAG AA). */
@custom-variant dark (&:is(.dark *));
@theme inline { --font-heading: var(--font-sans); --font-sans: 'Geist Variable', sans-serif; --color-sidebar-ring: var(--sidebar-ring); --color-sidebar-border: var(--sidebar-border); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar: var(--sidebar); --color-chart-5: var(--chart-5); /* Not shadcn's: the confetti's colors, as the charts' (bright: the charts' are grey). */ --color-confetti-1: var(--sc-confetti-1); --color-confetti-2: var(--sc-confetti-2); --color-confetti-3: var(--sc-confetti-3); --color-confetti-4: var(--sc-confetti-4); --color-confetti-5: var(--sc-confetti-5); --color-chart-4: var(--chart-4); --color-chart-3: var(--chart-3); --color-chart-2: var(--chart-2); --color-chart-1: var(--chart-1); --color-ring: var(--ring); --color-input: var(--input); --color-border: var(--border); --color-destructive: var(--destructive); /* Not shadcn's: the toast's success and warning. */ --color-success: var(--sc-success); --color-warning: var(--sc-warning); --color-accent-foreground: var(--accent-foreground); --color-accent: var(--accent); --color-muted-foreground: var(--muted-foreground); --color-muted: var(--muted); --color-secondary-foreground: var(--secondary-foreground); --color-secondary: var(--secondary); --color-primary-foreground: var(--primary-foreground); --color-primary: var(--primary); --color-popover-foreground: var(--popover-foreground); --color-popover: var(--popover); --color-card-foreground: var(--card-foreground); --color-card: var(--card); --color-foreground: var(--foreground); --color-background: var(--background); --radius-sm: calc(var(--radius) * 0.6); --radius-md: calc(var(--radius) * 0.8); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) * 1.4); --radius-2xl: calc(var(--radius) * 1.8); --radius-3xl: calc(var(--radius) * 2.2); --radius-4xl: calc(var(--radius) * 2.6);}
:root { --background: oklch(1 0 0); --foreground: oklch(0.145 0 0); --card: oklch(1 0 0); --card-foreground: oklch(0.145 0 0); --popover: oklch(1 0 0); --popover-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); --secondary-foreground: oklch(0.205 0 0); --muted: oklch(0.97 0 0); /* Not shadcn's (0.556): 4.5:1 on the muted background (inactive tabs…). */ --muted-foreground: oklch(0.54 0 0); --accent: oklch(0.97 0 0); --accent-foreground: oklch(0.205 0 0); /* Not shadcn's (0.577): 4.5:1 for text-destructive on bg-destructive/10. */ --destructive: oklch(0.52 0.245 27.325); /* Not shadcn's: the toast's success and warning text, 4.5:1 on the popover even at 90% opacity. */ --sc-success: oklch(0.49 0.14 150); --sc-warning: oklch(0.52 0.15 49); --border: oklch(0.922 0 0); --input: oklch(0.922 0 0); --ring: oklch(0.708 0 0); --chart-1: oklch(0.87 0 0); --chart-2: oklch(0.556 0 0); --chart-3: oklch(0.439 0 0); --chart-4: oklch(0.371 0 0); --chart-5: oklch(0.269 0 0); /* Not shadcn's: the confetti's colors. */ --sc-confetti-1: oklch(0.646 0.222 41.116); --sc-confetti-2: oklch(0.6 0.118 184.704); --sc-confetti-3: oklch(0.488 0.243 264.376); --sc-confetti-4: oklch(0.828 0.189 84.429); --sc-confetti-5: oklch(0.645 0.246 16.439); --radius: 0.625rem; --sidebar: oklch(0.985 0 0); --sidebar-foreground: oklch(0.145 0 0); --sidebar-primary: oklch(0.205 0 0); --sidebar-primary-foreground: oklch(0.985 0 0); --sidebar-accent: oklch(0.97 0 0); --sidebar-accent-foreground: oklch(0.205 0 0); --sidebar-border: oklch(0.922 0 0); --sidebar-ring: oklch(0.708 0 0);}
.dark { --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0); --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0); --popover: oklch(0.205 0 0); --popover-foreground: oklch(0.985 0 0); --primary: oklch(0.922 0 0); --primary-foreground: oklch(0.205 0 0); --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0); --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.708 0 0); --accent: oklch(0.269 0 0); --accent-foreground: oklch(0.985 0 0); --destructive: oklch(0.704 0.191 22.216); --sc-success: oklch(0.792 0.209 151.711); --sc-warning: oklch(0.828 0.189 84.429); --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.556 0 0); --chart-1: oklch(0.87 0 0); --chart-2: oklch(0.556 0 0); --chart-3: oklch(0.439 0 0); --chart-4: oklch(0.371 0 0); --chart-5: oklch(0.269 0 0); --sc-confetti-1: oklch(0.705 0.213 47.604); --sc-confetti-2: oklch(0.696 0.17 162.48); --sc-confetti-3: oklch(0.627 0.265 303.9); --sc-confetti-4: oklch(0.852 0.199 91.936); --sc-confetti-5: oklch(0.645 0.246 16.439); --sidebar: oklch(0.205 0 0); --sidebar-foreground: oklch(0.985 0 0); --sidebar-primary: oklch(0.488 0.243 264.376); --sidebar-primary-foreground: oklch(0.985 0 0); --sidebar-accent: oklch(0.269 0 0); --sidebar-accent-foreground: oklch(0.985 0 0); --sidebar-border: oklch(1 0 0 / 10%); --sidebar-ring: oklch(0.556 0 0);}
@layer base { * { @apply border-border outline-ring/50; /* Not shadcn's: lets heights animate to and from auto (collapsible, accordion). */ interpolate-size: allow-keywords; } body { @apply bg-background text-foreground; } html { @apply font-sans; }} The components use nova. For another style, give it when the app starts, and point the second @source at its file (…-styles-lyra.mjs):
import { lyra } from '@semantic-components/styles/lyra';import { provideSemanticComponents } from '@semantic-components/ui';
export const appConfig: ApplicationConfig = { providers: [provideSemanticComponents({ preset: { style: lyra } })],};Usage
Import and use components in your Angular templates:
import { Component, ViewEncapsulation } from '@angular/core';import { ScButton } from '@semantic-components/ui';
@Component({ selector: 'app-button-usage-demo', imports: [ScButton], template: ` <button scButton>Click me</button> `, host: { class: 'flex w-full justify-center' }, encapsulation: ViewEncapsulation.None,})export class ButtonUsageDemo {}AI coding assistants
Optional: give your assistant the library's docs with the MCP server. Add it to your project's .mcp.json; npx -y fetches it on first use, nothing to install.
{ "mcpServers": { "semantic-components": { "command": "npx", "args": ["-y", "@semantic-components/mcp-server"] } }}