Widget Toggling
Learn how to enable or disable specific dashboard components.
Overview
LibreApps Desktop allows you to fine-tune the user experience by toggling individual widgets and sections on or off. This is managed through the Navigation & Pages and Widget Toggling sections of the settings.md file.
How it Works
The rebrand engine uses a technique called "conditional compilation" (or simple file modification) to remove or comment out the code responsible for rendering specific widgets.
1. Sidebar & Navigation
When you disable a section like Analytics in settings.md, the rebrand-nav-logic.js script removes the corresponding entry from the sidebar configuration file.
2. Page Components
For individual widgets on a page (e.g., the Revenue Card), the engine looks for specific markers in the JSX code and wraps them in conditional logic or removes them entirely.
Configuration Example
In rebrand/settings.md:
### [ ] Section: Dashboards
- [x] **Analytics**
- [ ] **CRM**
## Widget Toggling
- [x] **Revenue Card**
- [ ] **Sales Chart**
In this example:
- The Analytics dashboard will be visible in the sidebar.
- The CRM dashboard will be hidden.
- The Revenue Card will be rendered on the analytics page.
- The Sales Chart will be removed from the analytics page.
Benefits
- Simplified UI: Only show the features that are relevant to your users.
- Performance: Reducing the number of rendered components can improve page load times.
- Customization: Easily create different versions of your dashboard for different client tiers.
Best Practices
- ✅ Do this: Disable any widgets that you don't plan to use to keep the dashboard clean.
- ✅ Do this: Verify that disabling a widget doesn't break the layout of the remaining components.
- ❌ Don't do this: Manually delete widget files from the
src/directory; use the toggling mechanism instead.