Utilização

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>;

Declaração do tipo

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

Membros 2

NomeTipoObrigatórioDescrição
colorSchemeSchemeSim—
fontScalenumberSim—
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.