AppearancePreferences
The user's display preferences together, for tests and code that need both at once.
Verwendung
Read the system display preferences.
// 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
export type AppearancePreferences = {
colorScheme: ColorSchemeName | null;
fontScale: number;
};Mitglieder 2
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
colorScheme | Scheme | Ja | — |
fontScale | number | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.