Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Blocks
  2. App Header
  3. Usage

App Header

Usage

Import @prepared911/ui/blocks/app-header. The block has no stylesheet of its own; load @prepared911/ui/blocks/control-island/styles.css and the styles.css of each component the header renders (Box, Button, ButtonGroup, Icon, Menu, Navbar, Separator, Tabs, Text, UserMenu, VisuallyHidden). AppHeader is the application header product screens render. It is Navbar composed into exactly one of the three headers of the design: Calltaker, Dispatcher or Supervisor. role is required and decides everything else: the ControlIsland at the start, the route tabs, and the controls at the end. The header has no slots and takes no children or className; a host supplies the copy, where each route goes, the state, and the handlers.
The three headers
RoleIslandRoute tabsEnd
Calltakerheadset badge, queue, raise hand, availability pillLive, Archivedgraduation-cap, bell-ring, account cog (settings), separator, settings-2, fullscreen, x
Dispatcherroute badge, channel, raise handLive, Archivedgraduation-cap, bell-ring, account cog, separator, settings-2, fullscreen, x
Supervisorrole switcher: Supervisor, Calltaker, DispatcherLive, Archived, Learning, Settingsbell-ring, separator, fullscreen, x
Each role takes only its own props: the Dispatcher has no availability, and the Supervisor has no queue, raise hand, training, account cog, or preferences.
Routes
routes is a record keyed by route, not a list, so the header decides which tabs exist and their order. Give each route an href and a label, and extraRouteMatchers when a deeper route should also mark it current. The current tab is the one whose href matches currentPath (pathname equality, or matchPath if you pass one). A tab press and an overflow row press call navigate(href). Routes that do not fit move, from the end, into a menu behind the overflowLabel control.
State
  • Availability (Calltaker): status and onStatusChange, or uncontrolled with defaultStatus (Busy). Set ControlIslandStatus.Ringing while a call is incoming and put the person's choice back when it ends. See ControlIsland.
  • Raise hand (Calltaker, Dispatcher): raisedHand and onRaisedHandChange, or defaultRaisedHand.
  • Role switcher (Supervisor): activeRole and onActiveRoleChange, or defaultActiveRole (Supervisor). The switcher says which role the supervisor is looking at; the header stays the Supervisor header.
Every on…Change handler gets change details; cancel them to keep the previous value.
End controls
Each end control takes a name and an optional press handler: onTrainingPress, onNotificationsPress, onPreferencesPress, onFullscreenPress and onClosePress. The controls after the separator form a group named by toolsLabel.
Landmark and placement
The bar is the page banner by default. A shell that already has a banner passes landmark={NavbarLandmark.Navigation}. sticky and stickyInset keep the bar at the top while the page scrolls. Render one AppHeader per page, where AppShell places the Navbar.
Migrating core/navbar and ui-core Navbar
AppHeader is the target only when the bar is one of the three headers of the design. A shell whose bar has other tabs, counts on tabs or other end controls migrates through the Navbar parts and not through AppHeader: the shell's core/navbar remote (Home, Communications, Dashboard and so on) and dispatch's navbar are that case. The Navbar migration section lists every prop and shows how to move from target ids to hrefs. AppHeader cannot carry those bars by design. Its routes are a fixed record per role with an href, a label and extraRouteMatchers (AH-3), so there is no counter, no icon and no extra tab, and it has no slots (AH-2), so there is no place for another control.
Props for a bar that is one of the three
ui-coreAppHeaderNotes
Navbar ariaLabellabelRequired in both landmarks (AH-7). The route list's landmark is named by navigationLabel, also required
Navbar classNamenot carriedNo className, id, ref or style (AH-2)
NavbarBrand ariaLabelhomeLabelRequired. The brand is always a link: homeHref is required too
NavbarBrand variantnot carriedThe brand is the Axon mark
NavbarBrand multiApp, apps, currentApp, onSelectApp, appMenuLabelnot carriedBy owner decision. Nothing in the header replaces the menu of apps; see App switcher
NavbarTabs itemsroutesA record keyed by route, not a list: { live, archived }, plus learning and settings for the Supervisor. to becomes a real href
NavbarTabs currentPath, navigate, matchPathcurrentPath, navigate, matchPathnavigate gets the route's href. currentPath is a pathname. Moving from ids to hrefs works as in Routes
NavbarTabs overflowMenuLabeloverflowLabelRequired
NavbarSkeleton ariaLabelnot part of AppHeaderAppHeader has no loading state. Use Navbar's NavbarSkeleton, whose ariaLabel is label
TabNav, TabNavItemnot part of AppHeaderThey become Tabs in link mode; see the Navbar section
Open decisions (owner-pending)
Both are open, and AppHeader does neither today. The options are in Navbar's open decisions.
  • Agency switcher. AppHeader has no agency control, because the three headers of the design have none and the block takes no slots (AH-2). What the shell has today is a Combobox in the end cluster that appears when a person has more than one agency.
  • Unread count on the bell. The bell is press-only with a fixed name, because the design shows no count (AH-5). The shell today draws a count over the bell and puts it in the bell's name.
The account menu
Calltaker and Dispatcher render UserMenu behind the account cog (settings, 16px), named by accountLabel. The menu shows the account name, optional email, the theme row from appearanceLabels, and Sign out last. Settings-2 stays the preferences control (preferencesLabel, onPreferencesPress) and does not open the menu. The Supervisor header has no account cog and no preferences control.
Not for
A bar that is not one of these three headers. A shell with other tabs builds its bar from the Navbar parts (see the migration section above); a change to the three headers is a change to this block.
Previous
Page Header / Accessibility
Next
App Header / API and Development
On this page
The three headers
Routes
State
End controls
Landmark and placement
Migrating core/navbar and ui-core Navbar
Props for a bar that is one of the three
Open decisions (owner-pending)
The account menu
Not for