PXD

useColorScheme

Manages dark/light color scheme with localStorage persistence and multi-instance synchronization.

Exports

function useColorScheme(options?: Options): {
  isDark: ComputedRef<boolean>
  colorScheme: Ref<ColorPreference>
  toggleDarkMode: () => void
}

Types

interface Options {
  syncStatus?: boolean
}

Params

NameTypeDescription
options.syncStatusbooleanWhether to synchronize scheme status across instances

Source

Source