Skip to content

pantoken / renderers/react-native/src / tokensForScheme

Fonksyon: tokensForScheme()

tokensForScheme(scheme): Record<string, RNTokenValue>

Eksperimantal

Chwazi objè token pou yon eskèm koulè (pè ak RN's useColorScheme).

Paramèt

scheme

"light" | "dark" | null | undefined

Retounen

Record<string, RNTokenValue>

Egzanp

tsx
import { useColorScheme } from "react-native";
import { tokensForScheme } from "@pantoken/react-native";

const t = tokensForScheme(useColorScheme());
const styles = { card: { backgroundColor: t.colorBackgroundBase, padding: t.spacingSpaceMd } };