Skip to content
  • Android
  • iOS
  • Web

useNTheme

Read or change the active engine theme.

Engine API useNThemenayan-ui/components

Live examples

Example.tsx

Parameters

This hook takes no parameters.

Return value

useNTheme return value
NameTypeDetails
setTheme(theme: NThemeMode) => void
toggleTheme() => voidSwitch to the opposite of the currently resolved light/dark appearance.
themeNThemeModeSelected preference; use resolvedTheme for the active light/dark appearance.
resolvedTheme"light" | "dark"
systemTheme"light" | "dark"
isDarkModeboolean
paletteNThemePaletteActive application tokens, including camelCase aliases of semantic colors.
colorsPartial<Record<ComponentThemeColor, string>>Semantic overrides; unspecified colors retain the renderer's defaults.

Tags