Overview
ToolbarComponent renders the top application toolbar. It displays the current page title, provides navigation controls (sidenav toggle or home link depending on viewport size), and shows a progress bar during loading operations.
Selector
Usage
Inputs
Indicates whether the current viewport is large (desktop). Changes toolbar behavior:
- true: Shows sidenav toggle button
- false: Shows home navigation button
Determines if safe area padding should be added for devices with notches or rounded corners (iOS, modern Android).
Outputs
Emitted when the user clicks the sidenav toggle button (large viewport only). Parent component should handle opening/closing the sidenav.
Properties
Protected Properties
Signal containing progress bar state from
ProgressBarService:isVisible: boolean - Whether progress bar is shownmode: ProgressBarMode - ‘determinate’, ‘indeterminate’, ‘buffer’, or ‘query’value: number - Progress value (0-100)bufferValue: number - Buffer value for buffer mode
Signal containing the current toolbar title from
ToolbarTitleService. Shows “loading” if null.Template Structure
The toolbar adapts based on viewport size:Large Viewport (Desktop)
Small Viewport (Mobile)
Features
Progress Bar
Displays at the top of the toolbar with configurable modes:- Query: Indeterminate with reverse animation (default for navigation)
- Indeterminate: Continuous animation
- Determinate: Shows specific progress percentage
- Buffer: Shows download progress with buffer
isVisible state.
Navigation Button
Behavior changes based on viewport:- Desktop: Toggle button to show/hide sidenav
- Mobile: Logo button linking to home page
Safe Area Support
WhenshouldAddSafeArea is true, the toolbar adds padding for:
- iPhone notch areas
- Android rounded corners
- Other device-specific safe areas
Analytics Tracking
Built-in analytics events:toggle_sidenav- When sidenav toggle clicked (desktop)open_home- When home logo clicked (mobile)
Dependencies
The component injects:LoggerService- Component initialization loggingProgressBarService- Progress bar state managementToolbarTitleService- Toolbar title state management
Example: Full Integration
Updating Toolbar Title
The toolbar title is managed byToolbarTitleService. Update it from any component:
PageComponent which automatically manages the toolbar title.
Styling
The toolbar includes these CSS classes:jet-sidenav-content-toolbar- Applied to toolbar containerjet-add-safe-area- Conditionally applied for safe area padding
toolbar.component.scss:
Accessibility
- Button includes
aria-labelfor screen readers - Tooltip provides additional context on hover
- Progress bar includes loading announcement
- High contrast mode supported
Source
Location:src/app/components/toolbar/toolbar.component.ts