Skip to content

UseInitTheme

katanakit-js / useInitTheme

function useInitTheme(options?): void;

Defined in: 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.

Parameter Type Description
options? ThemeOptions Configuration for the theme system.

void

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