Table of Contents
Examples
Basic UsageJavaScript Reference
ConstructorRequirements
Attributes
Properties
Methods
Static Methods
Description
The ThemeSwitcher
component allows users to switch between different themes. It extends the Component class.
Basic Usage
Use the ThemeSwitcher
component to allow users to switch between different themes. The component will automatically save the selected theme to local storage and apply it on page load.
<k-theme-switcher></k-theme-switcher>
JavaScript Reference
Constructor
Extends Component
new ThemeSwitcher()
Requirements
Attributes
The ThemeSwitcher
class does not introduce any new attributes beyond those provided by the Component class.
Methods
The ThemeSwitcher
class does not introduce any new methods beyond those provided by the Component class.
Static Methods
static setTheme(theme): void
Sets the specified theme and saves it to local storage.
static getCurrentTheme(): string
Gets the current theme from local storage or the document attribute.