AppsMenus Component
The AppsMenus component provides a dynamic, customizable menu system for Liberty Core applications. It allows defining nested menu structures that can be overridden using the getMenus function in AppProvider.
Overview
AppsMenus is the main navigation system for applications built with Liberty Core. It provides:
- Multi-level navigation for organizing modules and features.
- Dynamic content based on user roles and permissions.
- Overridable API to fully customize the menu structure.
Props
| Prop | Type | Description |
|---|---|---|
isOpen |
boolean |
Controls whether the menu drawer is open. |
onMenuSelect |
(component: ComponentProperties) => void |
Callback triggered when a menu item is selected. |
onToggleMenusDrawer |
() => void |
Toggles the menu drawer open or closed. |
Overriding Menu Content
The menu system can be customized by passing a custom getMenus function to AppProvider.
Example Menu Structure
Menus follow a hierarchical structure, where each menu item can have: - Children (submenus) - Components assigned for navigation - Attributes controlling behavior
How to Override in AppProvider
To override the default menu, pass the function when setting up AppProvider:
By overriding getMenus, you can customize navigation dynamically based on:
- User roles (e.g., different menus for admin and users).
- Feature availability (e.g., show or hide based on permissions).
- Application state (e.g., load menus dynamically from an API).
Example Usage
Useful Links
🔗 GitHub Repository (Core): Liberty Core
🔗 GitHub Repository (Test Project): Liberty Test
📖 Live Documentation: Liberty Core Docs
💖 Sponsor & Support: Sponsor Liberty Core