kor TürkçeGitHub

Theme

Applies appearance settings at runtime.

kor/ui/ThemeSource

When to use

  • Let users change density or apply a brand color across Kor controls.

Examples

Toggle density

Loading the example

<k:Button text="Switch cozy or compact" press=".onDensity"/>

Preview and restore a brand color

Appearance settings apply to the whole page.

Loading the example

<k:Stack row="true" gap="8">
	<k:Button kind="accent" text="Preview green" press=".onPreview"/>
	<k:Button text="Restore color" press=".onRestore"/>
</k:Stack>

API

Methods

NameDescription
get(): ThemeSettingsReturns a copy of the current theme settings
isDark(): booleanReturns whether dark mode is active, including the system preference
set(next: Partial<ThemeSettings>): voidUpdates the supplied theme settings and applies them to the page
type ThemeSettings = { mode: "light" | "dark" | "system"; accent: string; density: "cozy" | "compact"; radius: number };