Nxpress LogoNxpressv1.3.8
14

Client API & Theme Management

Nxpress injects client-side utilities and flicker-free dark mode controls under window.__nxpress__.

Theme Management API (window.__nxpress__.theme)

Usage in View Templates
MethodReturn TypeDescription
window.__nxpress__.theme.get()'dark' | 'light'Returns the currently active theme preference.
window.__nxpress__.theme.set(mode)voidSets theme mode ('dark', 'light', 'system') and persists in localStorage.
window.__nxpress__.theme.toggle()'dark' | 'light'Toggles theme mode between dark and light, returning the new state.