API

ThemeService API Documentation

ThemeService is the core service for managing themes in your application. It provides methods and properties for setting, getting, and manipulating themes.

Properties

A signal that provides the current active theme.

An observable that provides the current active theme.

A signal that indicates whether dark mode is currently active.

An observable that emits whether dark mode is currently active.

A signal that provides all available themes (system and custom).

An observable that emits all available themes (system and custom).

A signal that provides the current dark mode type ("light", "dark", or "system").

An observable that emits the current dark mode type ("light", "dark", or "system").

A signal that provides the list of custom themes added by the user.

An observable that emits the list of custom themes added by the user.

A signal that provides the list of system (built-in) themes.

An observable that emits the list of system (built-in) themes.

Methods

Sets the current theme based on the provided ThemeOption object.

Sets the current theme by its identifier value. Returns true if successful.

Sets the application's light/dark mode. Use 'light', 'dark', or 'system'.

Applies a theme to the document or a specific element. Useful for local theming.

Adds a custom theme to the list of available themes.

Removes a custom theme by its value.

Reapplies the current application theme. Useful after temporarily previewing other themes.

Resets all theme settings to system defaults and clears custom themes.

Exports the current theme settings as a serializable object.

Usage Examples