Sidebar
A composable, themeable and customizable sidebar component.
About
The sidebar component is highly flexible and follows the patterns of popular UI libraries. It supports multiple variants like floating, inset, and standard sidebar layouts, with built-in support for collapsible sections and icon-only states.
Installation
Run the following command to install the sidebar component:
Theming
Add the following variables to your CSS file to theme the sidebar:
Usage
Import the sidebar components in your layout:
Sidebar Configuration Provider
Configure global sidebar settings like width and breakpoints in your app.config.ts:
Application Sidebar
A basic sidebar with menu items and an inset main content area.
Variants (Floating & Inset)
Demonstration of floating sidebars and inset main content layouts with semantic colors.
Collapsible & Submenus
Sidebars with collapsible groups, nested submenus, and footer profiles.
Group & Menu Actions
Add interactive actions to groups and menu items, including dropdown menus.
Deeply Nested Hierarchies
Support for complex application structures with multi-level nested submenus.
Themed & Feature-Rich
A full-featured sidebar with header switchers, badges, and custom dark themes.
API Reference
Brain API
| Service/Directive | Selector | Description |
|---|---|---|
| HlmSidebarService | - | Handles state (expanded/collapsed) and persistence. |
| BrnSidebarTrigger | [brnSidebarTrigger] | Core logic for toggling the sidebar. |
Helm API
| Directive | Selector | Description |
|---|---|---|
| HlmSidebar | hlm-sidebar | The root sidebar component. |
| HlmSidebarContent | [hlmSidebarContent] | Container for the scrollable part of the sidebar. |
| HlmSidebarGroup | [hlmSidebarGroup] | A logical group of menu items. |
| HlmSidebarMenu | [hlmSidebarMenu] | A list of menu items. |
| HlmSidebarMenuItem | [hlmSidebarMenuItem] | A wrapper for a menu button or link. |
| HlmSidebarMenuButton | [hlmSidebarMenuButton] | The interactive part of a menu item. |