Topbar
The Topbar widget appears as an icon in the top navigation bar of the Facilio interface. Clicking the icon opens a topbar panel. Use it for notifications, quick actions, or utility panels that users need quick access to from any page.

Availability#
| Apps | Mobile |
|---|---|
| Maintenance | No |
Single widget per account
Only one Topbar widget is supported per account. Whichever loads first is used; multiple instances are not supported.
When to use#
- Building a notification center or alert panel
- Providing quick-action tools accessible from any page
- Displaying real-time status information (help desk queue, pending approvals)
- Embedding a mini utility (calculator, quick search, notes)
Triggers#
| Function | Description | Example |
|---|---|---|
| show | Shows the topbar menu icon in the nav bar. Hidden by default. | window.facilioApp.interface.trigger('show'); |
| hide | Hides the topbar menu icon from the nav bar | window.facilioApp.interface.trigger('hide'); |
| showHeader | Shows or hides the topbar panel header | window.facilioApp.interface.trigger('showHeader', true); |
| setUnseenCount | Sets the unseen/badge count on the topbar icon | window.facilioApp.interface.trigger('setUnseenCount', 5); |
| setIcon | Changes the icon displayed in the topbar | window.facilioApp.interface.trigger('setIcon', { iconGroup: 'default', icon: 'notification' }); |
| setTitle | Sets the topbar panel title | window.facilioApp.interface.trigger('setTitle', { title: 'Notifications' }); |
| resize | Resizes the topbar panel height | window.facilioApp.interface.trigger('resize', { height: 400 }); |
setUnseenCount — Pass a number for the badge count. Pass 0 or omit to clear. Falsy values default to 0.
setIcon — Requires both iconGroup and icon. The icon group determines the icon set; icon is the icon name within that group. Call setIcon before show if you need to configure the icon before making it visible.
show / hide — The topbar menu icon is hidden by default. Call setIcon to configure the icon, then call show to make it visible in the nav bar. Use hide to hide the icon again.
showHeader — Pass true to show the header, false to hide it.
Events#
| Event | Description | Example |
|---|---|---|
| topbar.active | Fires when the topbar panel is opened | app.on('topbar.active', callback); |
| topbar.inactive | Fires when the topbar panel is closed | app.on('topbar.inactive', callback); |
| navigation.change | Fires when the app URL changes. Payload: { url } — current app URL. | app.on('navigation.change', callback); |
app.on('topbar.active', () => { console.log('Panel opened — refresh data'); loadNotifications();});
app.on('topbar.inactive', () => { console.log('Panel closed');});
app.on('navigation.change', ({ url }) => { console.log('App navigated to:', url);});Example — Notification panel with unseen count#
var app = new Vue({ el: '#app', data: { notifications: [], unreadCount: 0, subscribedToken: null }, created() { window.facilioApp = FacilioAppSDK.init(); window.facilioApp.on('app.loaded', async () => { window.facilioApp.interface.trigger('setIcon', { iconGroup: 'default', icon: 'notification' }); window.facilioApp.interface.trigger('show'); // Icon is hidden by default await this.refreshNotifications();
this.subscribedToken = await window.facilioApp.liveevent.subscribeUserEvent('new_notification'); window.facilioApp.on(this.subscribedToken, () => { this.unreadCount++; window.facilioApp.interface.trigger('setUnseenCount', this.unreadCount); }); });
window.facilioApp.on('topbar.active', async () => { await this.refreshNotifications(); window.facilioApp.interface.trigger('setUnseenCount', 0); this.unreadCount = 0; }); }, methods: { async refreshNotifications() { try { const { list } = await window.facilioApp.api.fetchAll('custom_notifications', { viewName: 'all', perPage: 20, orderType: 'desc' }); this.notifications = list || []; this.unreadCount = this.notifications.filter(n => !n.isRead).length; if (this.unreadCount > 0) { window.facilioApp.interface.trigger('setUnseenCount', this.unreadCount); } } catch (error) { console.error('Failed to load notifications:', error); } } }});