Skip to content

Angular

@theme-kit/angular

AngularDI7 exports

Angular providers, injectables and an element-scoped directive.

Install the integration alongside @theme-kit/core.

bash
pnpm add @theme-kit/angular

Quick Start

Complete copy-paste usage for this package.

app.config.ts
ts
1import { provideThemeKit } from "@theme-kit/angular";
2
3export const appConfig: ApplicationConfig = {
4  providers: [
5    provideThemeKit({
6      themes,
7      defaultTheme: "light",
8    }),
9  ],
10};

More Examples

Additional patterns for Angular.

app.ts
ts
1import { injectTheme } from "@theme-kit/angular";
2
3@Component({ ... })
4export class AppComponent {
5  private theme = injectTheme();
6
7  toggle() {
8    this.theme().toggleTheme();
9  }
10}

API Reference

Curated highlights below. The complete generated reference — every signature, parameter and type — is at /api-reference/angular.

Providers

ExportDescription
provideThemeKit(options)App provider that wires the runtime.
provideThemeKitRuntime(runtime)Share an existing runtime.

Injectables

ExportDescription
injectThemeRuntime()Runtime injector.
injectTheme()Reactive ThemeState — theme, mode, family + setters.
injectThemeHistory / injectThemeBatchHistory and batching.
injectThemeSnapshot / injectThemeRestoreSerialize / restore.

Directives

ExportDescription
ThemeScopeDirectiveElement-scoped theming.
@theme-kit/angular — Theme Kit