Usage

Read the current color scheme.

tsx
// Read the current color scheme.
import { appearance, watch } from 'kuito';

appearance.colorScheme.value; // 'light' | 'dark' | null
appearance.fontScale.value; // 1 by default
watch(appearance.fontScale, (scale) => console.log(scale)); // in a component

Signatures

ts
<T>(source: ReadonlySignal<T> | (() => T), fn: (next: T, previous: T | undefined) => void | (() => void), options?: { immediate?: boolean; }, name?: string): EventSubscription

Type parameters

NameConstraintDefault
T——

Parameters

NameTypeRequiredDescription
sourceReadonlySignal<T> | (() => T)Yes—
fn(next: T, previous: T | undefined) => void | (() => void)Yes—
options{ immediate?: boolean;}No—
Default: {}
namestringNo—

Returns

EventSubscription

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.