- Android
- iOS
- Web
Theme
Render a themed screen and configure its colour mode, tokens, and shared services.
Engine API NThemenayan-ui/components
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
| Name | Type | Default | Details |
|---|---|---|---|
| children | ReactNode | Optional | |
| className | string | Optional | Supported Tailwind-style utilities, resolved entirely in Rust. See the engine README. |
| style | ComponentStyleProp | Optional | |
| surface | false | NThemeSurfaceOptions | Optional | Screen viewport and rendering options. Set false around an existing navigator or platform layout. |
| safeArea | boolean | Optional | Root themes supply safe-area measurements when no provider already exists. Default: true. |
| defaultTheme | NThemeMode | Optional | Initial uncontrolled preference. Root themes default to system; nested themes inherit. |
| themes | { light?: ComponentThemeColors; dark?: ComponentThemeColors; } | Optional | |
| colors | Partial<Record<ComponentThemeColor, string>> | Optional | Semantic theme-token overrides, scoped to NTheme and its descendants. |
| components | Readonly<Record<string, { className?: string; style?: ComponentStyle; }>> | ((appearance: NThemeAppearance) => ComponentProps["components"]) | Optional | Static defaults or a resolver that updates when the active appearance changes. |
| radius | number | Optional | Base radius in logical points, scoped to NTheme descendants. |
| stylesheet | string | Optional | Browser CSS rules compiled to the Rust layout backend. |
| fonts | NThemeFonts | Optional | Root UI typefaces, loaded through engine assets. Native navigation may register the same faces with its platform font loader. |
| persistence | NThemePersistence | Optional | Persist and observe the preference in engine storage, independently of account state. |
| onThemeChange | ((theme: NThemeMode) => void) | Optional | Observe changes, or update a controlled `theme` preference in the application store. |
| systemBars | boolean | SystemBarsOptions | Optional | Root themes manage native system bars automatically; nested themes opt in. |
| navigation | SystemBarsNavigation | Optional | Restrict this system-bar scope to its focused screen, including frozen screens. |