Skip to content

Patterns · Navigation

IdentityBar

The top bar of a Rook app: product name, search, notifications and the account menu.

@rookcom/monarch-react/shellPattern

Product, search, notifications and account

Usage examples

Context and actions, without a link

Purpose

Shows which product you are in and who you are signed in as, with room for search and notifications.

Use when

  • The top of a signed-in app page, inside AppShell next to RookRail, or alone in an app without a rail.

Avoid when

  • Marketing pages with product menus: use the marketing site shell (SiteHeader) from @rookcom/monarch-react/marketing.
  • A page title with actions: use PageHeader inside the main region.

Design principles

  • The product name is always visible text, never only a logo.
  • Slots, not settings: search, start, actions and notifications are whatever the app passes.
  • The account menu is the same as the rail’s, so Profile, Rook account and Sign out are in the same order everywhere.

API reference

import { IdentityBar } from '@rookcom/monarch-react/shell';
ExportKindRenderingRoot class
IdentityBarcomponentclient.mn-identity-bar

Forwards its ref to the <header>.

account has the same shape as RookRail’s.

Generated from the TypeScript declarations of packages/react/src/patterns/navigation/identity-bar.

Properties

product: { name, href?, logo? }. Without href the name is plain text.

sticky (default true) keeps the bar at the top of its scrolling area.

IdentityBar

The top identity bar of a Rook app: the product name, an optional start slot (breadcrumb, Space), a search slot, trailing actions, notifications and the account menu. It is the page banner (`<header>`); pair it with RookRail inside AppShell, or use it alone in apps without a rail.

PropTypeDescription
product requiredIdentityBarProduct
accountShellAccountThe signed-in person: avatar button and account menu.
actionsReactNodeOther trailing actions (help, theme toggle), before notifications.
classNamestring
idstring
linkComponentShellLinkComponentLink element for client navigation. Default `<a>`.
messagesPartial<AccountMenuMessages>Interface text, for translation.
notificationsReactNodeNotifications button or popover trigger.
searchReactNodeSearch field or command-palette button. Takes the free space; wraps below on narrow screens.
startReactNodeAfter the product name: a breadcrumb, a page title or a Space switcher.
stickybooleanStick to the top of the scrolling area. Default true.

Variants

PropValuesDescription
sticky'true''false'Sticks to the top of the scroll container (data-sticky).

States

StateExposed asBehaviour
Stickydata-stickyDefault.
Account menu openaria-expanded="true"On the avatar button.

Interaction behaviour

  • The product name links home through linkComponent when href is set.
  • The avatar button opens the account menu: the person, Profile, extra entries, Rook account (new tab) and Sign out.

Keyboard support

KeysAction
TabProduct link, slots in order, then the account button.
Enter / Space / ↓Open the account menu with focus on its first item.
↓ / ↑Move through the menu.
EscapeClose the menu and return focus to the avatar button.

Accessibility

Role
banner landmark (<header> outside main)
Accessible name
The product link is named by the product name; the avatar button is "Account: <name>".
  • The logo is decorative; the name is text.
  • The account menu is a Monarch DropdownMenu (APG menu button), with the person’s name and email as its label.
  • New-tab links say so to screen readers.

Responsive behaviour

  • The product name truncates; below 640px the search slot moves to its own full-width row.
  • The avatar button is 44px on touch screens.

Theme support

  • Surface, border and text tokens; works in every theme and more-contrast mode.

Do and don't

Do

  • Use one IdentityBar per page, at the top of AppShell.
  • Name search fields and icon buttons you pass into the slots.

Don't

  • Do not put primary navigation here; that is the rail’s job.
  • Do not repeat the account menu in the bar when the rail already shows it, unless the app has no rail.

Dependencies

KindDepends on
npm packagesreact
Monarch componentsAvatar, DropdownMenu

Testing coverage

  • Banner landmark with the product link, search and notifications slots.
  • Plain product name without href; start and actions slots.
  • Account menu from the keyboard with the person, Profile and Sign out; Escape returns focus.
  • Link component, translated messages, sticky off, server render.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesVisual baselines: /__gallery/identity-bar; Cross-browser axe: /components/identity-bar

Tests: packages/react/src/patterns/navigation/identity-bar