Demo

Zustand stores

Builtin shell Zustand stores from @quan-erp/base-frontend. Plugins import these — do not recreate session, nav, or settings state in a plugin-local store.

Where to import

All public builtin stores are exported from @quan-erp/base-frontend (re-exported for PluginAPI). @quan-erp/shared-ui and @quan-erp/shared-frontend-core do not own these stores.

  • Package: @quan-erp/base-frontend
  • Most stores use the double-call pattern: useXStore()()
  • useAppRegistry is single-call (optional selector)
  • getXStore() helpers are for register() / non-React modules
TSXimport
1import { 2 useAppRegistry, 3 useNavMenuStore, 4 useBottomNavBarStore, 5 useWebEnvStore, 6 getWebEnvStore, 7 useRootComponentStore, 8 getRootComponentStore, 9 useHomeShortcutStore, 10 getHomeShortcutStore, 11 useSettingStore, 12 useAllowedAPIPermission, 13 usePerimssionTemplateStore, 14 getPerimssionTemplateStore, 15 useSportlightSearchStore, 16} from "@quan-erp/base-frontend";

Catalog

  • useAppRegistry — shell registry + signed-in userInfo (no useCurrentUserStore)
  • useNavMenuStore — top nav leading, label, menu/action items, visibility
  • useBottomNavBarStore — mobile bottom bar show/hide
  • useWebEnvStore / getWebEnvStore — runtime Vite env (API URL, flags, versions)
  • useRootComponentStore / getRootComponentStore — mount global overlays from plugins
  • useHomeShortcutStore / getHomeShortcutStore — home shortcut tile registry
  • useSettingStore — client cache of ERP settings map (locale, theme, …)
  • useAllowedAPIPermission — cached allowed APIs for Protected / checks
  • usePerimssionTemplateStore — role-UI permission templates (platform spelling)
  • useSportlightSearchStore — spotlight palette open/close (Sportlight spelling)

Critical rules

  • Import only from @quan-erp/base-frontend
  • Do not mirror userInfo, settings, or nav chrome in a plugin Zustand store
  • Double-call shell stores unless the page docs say single-call
  • Open a store page in the sidebar for API details and examples