Verwendung

Read the system display preferences.

tsx
// Read the system display preferences.
import { Text, appearance, type AppearancePreferences } from 'kuito';

function describe(preferences: AppearancePreferences): string {
  const scheme = preferences.colorScheme ?? 'no preference';

  return `${scheme}, text at ${Math.round(preferences.fontScale * 100)}%`;
}

<Text>
  {describe({ colorScheme: appearance.colorScheme.value, fontScale: appearance.fontScale.value })}
</Text>;

Typdeklaration

ts
export type AppearancePreferences = {
  colorScheme: ColorSchemeName | null;
  fontScale: number;
};

Mitglieder 2

NameTypErforderlichBeschreibung
colorSchemeSchemeJa—
fontScalenumberJa—
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.