Skip to content
  • Android
  • iOS
  • Web

Theme

Render a themed screen and configure its colour mode, tokens, and shared services.

Engine API NThemenayan-ui/components

Live examples

NTheme mounts the screen for you. Use surface={false} around an existing navigator or browser layout. A nested theme inside a rendered screen scopes the theme without opening another viewport.

Example.tsx

Attributes

NTheme attributes
NameTypeDefaultDetails
childrenReactNodeOptional
classNamestringOptionalSupported Tailwind-style utilities, resolved entirely in Rust. See the engine README.
styleComponentStylePropOptional
surfacefalse | NThemeSurfaceOptionsOptionalScreen viewport and rendering options. Set false around an existing navigator or platform layout.
safeAreabooleanOptionalRoot themes supply safe-area measurements when no provider already exists. Default: true.
defaultThemeNThemeModeOptionalInitial uncontrolled preference. Root themes default to system; nested themes inherit.
themes{ light?: ComponentThemeColors; dark?: ComponentThemeColors; }Optional
colorsPartial<Record<ComponentThemeColor, string>>OptionalSemantic theme-token overrides, scoped to NTheme and its descendants.
componentsReadonly<Record<string, { className?: string; style?: ComponentStyle; }>> | ((appearance: NThemeAppearance) => ComponentProps["components"])OptionalStatic defaults or a resolver that updates when the active appearance changes.
radiusnumberOptionalBase radius in logical points, scoped to NTheme descendants.
stylesheetstringOptionalBrowser CSS rules compiled to the Rust layout backend.
fontsNThemeFontsOptionalRoot UI typefaces, loaded through engine assets. Native navigation may register the same faces with its platform font loader.
persistenceNThemePersistenceOptionalPersist and observe the preference in engine storage, independently of account state.
onThemeChange((theme: NThemeMode) => void)OptionalObserve changes, or update a controlled `theme` preference in the application store.
systemBarsboolean | SystemBarsOptionsOptionalRoot themes manage native system bars automatically; nested themes opt in.
navigationSystemBarsNavigationOptionalRestrict this system-bar scope to its focused screen, including frozen screens.

Tags