Introduction
An accessible, semi-headless UI library for Angular: the component logic decoupled from its look — shadcn/ui's eight styles, or your own — with Tailwind CSS.
Why Semantic Components?
Building a modern web application in Angular often means choosing between two compromises:
- Monolithic component kits. Fast to install on day one, painful on day thirty: you end up fighting encapsulated styles, writing brittle
::ng-deepoverrides, and wrestling with components that take thirty inputs just to position an icon. - Copying the source code. You own the files completely — and your team is on the hook for keeping them in sync by hand whenever upstream updates a component, fixes a bug or improves its accessibility.
Semantic Components gives you the best of both. It divides the responsibility down the middle: you own the markup, the elements and the layout; the library handles keyboard navigation, accessibility, focus and the interchangeable styles (nova, vega, maia…). When a bug is fixed, a style refined or accessibility improved, you get it with a package update — without rewriting your templates.
Decoupling component logic from visual styles
What does semi-headless mean here? Headless libraries give you unstyled primitives and leave the styling to you — CSS modules, Sass or your own utility classes. Tightly coupled libraries hard-code their CSS into their components.
Semantic Components takes the middle way: the component logic is decoupled from the look, but styling follows one contract — Tailwind CSS and a typed style structure. Two packages:
- The logic (
@semantic-components/ui): attribute directives on native elements, WAI-ARIA accessibility, keyboard navigation, focus management and signals. Each part reads its classes from the style withinjectStyle(), without tying you to any CSS. - The look (
@semantic-components/styles): shadcn/ui's eight styles, ready to use — nova, vega, maia, lyra, mira, luma, sera and rhea. - Or your own design system. A style is a plain TypeScript object of the
ScStylestructure: build one from scratch, or start from one of the eight, and provide it withprovideSemanticComponents({ preset: { style: myStyle } }).
Only your style's CSS
You choose the style through Angular's dependency injection, and Tailwind's @source scans the library and that style's entry point only — no other style's classes in your CSS. Switching styles is a two-line change:
// app.config.tsimport { nova } from '@semantic-components/styles/nova';import { provideSemanticComponents } from '@semantic-components/ui';
export const appConfig: ApplicationConfig = { providers: [provideSemanticComponents({ preset: { style: nova } })],};/* styles.css: the library, and your style's file only */@source '../node_modules/@semantic-components/ui';@source '../node_modules/@semantic-components/styles/fesm2022/semantic-components-styles-nova.mjs';Named for their role
Every directive is named for its exact role in the interface, on the native element that has that role. Elsewhere, a button might get matTooltip="Save" — though the button isn't a tooltip, it opens one. Here:
- The button is
button[scTooltipTrigger]; the bubble it shows isdiv[scTooltip]. - The dialog opener is
scDialogTrigger, the paneldiv[scDialog], its headingh2[scDialogTitle], and its dismiss actionbutton[scDialogClose].
Because each directive says what it does, you know how the pieces fit before reading a line of documentation.
Composable by design
Instead of monolithic black boxes with dozens of inputs ([hasCloseButton]="true", [iconPosition]="'left'"), a component is small, focused parts that you assemble in your template:
<div scCard> <div scCardHeader> <h3 scCardTitle>Deploy project</h3> <p scCardDescription>Ship your latest preview to production.</p> </div> <div scCardBody> <span scBadge variant="secondary">Production</span> </div> <div scCardFooter> <button scButton class="w-full">Deploy now</button> </div></div>Several parts on one element
Parts are attribute directives on native elements, so one element can take several — no wrapper elements:
<div scDrawerProvider> <div scTooltipProvider> <button scButton variant="outline" size="icon" scDrawerTrigger scTooltipTrigger> <svg siMenuIcon></svg> <span class="sr-only">Open navigation</span> </button> <ng-template scTooltipPortal> <div scTooltip>Open navigation</div> </ng-template> </div> <!-- the drawer --></div> One native button, three responsibilities: its look (scButton), opening a drawer (scDrawerTrigger) and showing a tooltip (scTooltipTrigger).
Declarative state
Take a dialog. Many Angular libraries open one from a service, in code. Here, the dialog — its trigger, its content and its close button — lives in your component's template:
<div scDialogProvider [(open)]="isOpen"> <button scButton variant="outline" scDialogTrigger>Edit profile</button>
<ng-template scDialogPortal> <div scDialog> <div scDialogHeader> <h2 scDialogTitle>Edit profile</h2> <p scDialogDescription>Make changes to your profile here.</p> </div>
<!-- your form -->
<div scDialogFooter> <button scDialogClose variant="outline" size="default">Cancel</button> <button scButton type="submit">Save changes</button> </div> </div> </ng-template></div> The dialog's provider shares its state with its parts through Angular's dependency injection. Its open state is a binding: when isOpen() changes, the dialog opens or closes, with its animations, and nothing to tear down by hand.
Built for modern Angular
Built from the ground up for today's Angular, without the older ways:
- Signals and OnPush. Inputs, outputs and models are signals; it runs zoneless.
- Standalone only. No NgModules, no
forRoot(): import the directives you use in your component. - Temporal for dates and times. Built on the TC39 Temporal API (
Temporal.PlainDate,Temporal.PlainTime): no mutable JavaScriptDate, and no third-party date library. - Signal Forms. Every control is a Signal Forms control (
FormValueControl): typed values and validation from the field you bind. - Server-side rendering. Rendered on the server and hydrated without a mismatch; browser-only APIs are guarded.
- Direction and locale. Right to left built in, from Angular's
DirectionalityandLOCALE_ID— not inputs on each part.
Next steps
- Get started — set up an Angular app with Tailwind CSS and the CDK.
- Custom styles — create your own brand style, in the style structure.
- Components — 140+ accessible components, with live examples.
- Styles — shadcn's eight styles (nova, vega, lyra…) side by side.
- Theming guide — colour palettes, radius, fonts and dark mode.