Skip to content
0

katanakit-js / useInitTheme

Function: useInitTheme() ​

ts
function useInitTheme(options?): void;

Defined in: src/infrastructure/theme/theme.service.ts:116

Initializes the theme system. Reads the stored preference (or falls back to defaultMode), applies the theme, and registers a system color-scheme listener for "system" mode.

Parameters ​

ParameterTypeDescription
optionsThemeOptionsConfiguration for the theme system.

Returns ​

void

Example ​

ts
useInitTheme({
  defaultMode: "dark",
  storageKey: "app-theme",
  onChange: (mode, resolved) => console.log(mode, resolved),
});

Released under the MIT License.