Skip to main content

ZangoApp Reference

ZangoApp is the root component of your frontend. It lives in src/App.tsx and wraps everything — routing, auth, navbar, theme.

import { ZangoApp } from '@zango-core/crm-framework';
import * as customPages from './custom/pages';

const App = () => (
<ZangoApp
appInitializerEndpoint="/appbuilder/initializer/"
customPages={customPages}
/>
);

Core Props

PropTypeRequiredDescription
appInitializerEndpointstringYesAPI endpoint that returns routes, menus, and theme. Default: /appbuilder/initializer/
customPagesobjectYesMap of component names → React components. Import from ./custom/pages

Layout Props

PropTypeDefaultDescription
layoutConfig.showTopbarbooleantrueShow/hide the top bar
layoutConfig.showNavbarbooleantrueShow/hide the sidebar
layoutConfig.layoutTypestring'default'Layout variant ('default' or 'wide')
PropTypeDescription
showLogobooleanShow/hide logo at top of sidebar
showMenubooleanShow/hide menu items
isCollapsedbooleanStart sidebar collapsed
collapsiblebooleanAllow user to toggle collapse
customLogoReactNodeReplace default logo
customMenuReactNodeReplace entire menu
customMenuContentReactNodeAppend content below menu items
customBottomContentReactNodeSticky content pinned to bottom of sidebar
customNavbarComponentTypeReplace the entire navbar component

Topbar Props (topbarConfig)

PropTypeDescription
showProfilebooleanShow profile dropdown
customLeftContentReactNodeCustom content on the left
customRightContentReactNodeCustom content on the right (before profile)
customProfileMenuReactNodeReplace profile dropdown content
customTopbarComponentTypeReplace entire topbar

Auth Props (authConfig)

See Auth Customisation for full details.

KeyDescription
themeBackground, primaryColor, fonts, borderRadius
logoLogo URL, width, height
cardCard borderRadius, boxShadow, padding
loginTitle, subtitle, button text, tab config
roleSelectionRole selection page text and layout
twoFactor2FA page text and OTP config
resetPasswordForgot password and reset form text
providersOAuth provider button config
customComponentsReplace LoginPage, LoginCard, RoleSelection, TwoFactorAuth, etc.

useAppContext Hook

Access app data from any component inside ZangoApp:

import { useAppContext } from '@zango-core/crm-framework';

const MyComponent = () => {
const {
appData, // Raw initializer response
menu, // Navigation menu items for current role
routes, // Application routes
profileInfo, // Current user: name, email, role, etc.
appLogo, // App logo URL
appName, // Application name
theme, // Theme colours and typography
} = useAppContext();

return <div>Hello, {profileInfo?.name}</div>;
};

Custom Navbar Example

import { ZangoApp } from '@zango-core/crm-framework';
import * as customPages from './custom/pages';

const MyLogo = () => (
<div style={{ padding: '16px 20px', display: 'flex', alignItems: 'center', gap: 10 }}>
<img src="/logo.svg" width={28} />
<span style={{ fontWeight: 700 }}>MyApp</span>
</div>
);

const App = () => (
<ZangoApp
appInitializerEndpoint="/appbuilder/initializer/"
customPages={customPages}
navbarConfig={{
collapsible: true,
customLogo: <MyLogo />,
}}
topbarConfig={{
showProfile: true,
customRightContent: <NotificationBell />,
}}
layoutConfig={{
showTopbar: true,
showNavbar: true,
}}
/>
);