App Header

The CRM's 48 px navy bar: page links on the left, round actions and the user on the right. On navy, keyboard focus is the light halo alone. Notification rows fill the bell's list.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { AppHeader, HeaderNavLink, HeaderIconButton, NotificationRow } from "@leap-crm/design-system";

Header

Press a page to move the orange underline; hover for orange; Tab for the inset halo. The bell carries a red count and turns orange while its list is open (press it).

Icon buttons

32 px, the raised chrome tone at rest (navy-400 in light mode), a step lighter on hover, brand orange while open. The count hides at 0 and caps at 99+; screen readers hear it in the name.

Notification rows

Unread: dark title at 450 on white. Read: muted at 400 on the subtle fill. Hover or keyboard focus shows the muted highlight, never a ring.

What the examples share

The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.

import { Bell, BookUser, ChartLine, LayoutDashboard, Plus, Search, Sprout, SquareCheckBig, UserPlus } from "lucide-react";

import { useState } from "react";

import { AppHeader, Avatar, HeaderIconButton, HeaderNavLink, NotificationRow } from "@leap-crm/design-system";

const pages = [
  { label: "Dashboard", icon: <LayoutDashboard /> },
  { label: "Opportunities", icon: <Sprout /> },
  { label: "Contacts", icon: <BookUser /> },
  { label: "Insights", icon: <ChartLine /> },
];

function Header() {
  const [page, setPage] = useState("Opportunities");
  const [open, setOpen] = useState(false);
  return (
    <AppHeader
      className="w-full"
      nav={pages.map(item => (
        <HeaderNavLink
          key={item.label}
          href="/app-header"
          icon={item.icon}
          active={page === item.label}
          onClick={event => {
            event.preventDefault();
            setPage(item.label);
          }}
        >
          {item.label}
        </HeaderNavLink>
      ))}
      actions={
        <>
          <HeaderIconButton icon={<Plus />} aria-label="New" />
          <HeaderIconButton icon={<Search />} aria-label="Search" />
          <HeaderIconButton
            icon={<Bell />}
            aria-label="Notifications"
            count={3}
            open={open}
            onClick={() => setOpen(value => !value)}
          />
          <Avatar size="lg" person="staff" name="Jane Citizen" initials="JC" />
        </>
      }
    />
  );
}

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoUse AppHeader once, at the top of the app, with a HeaderNavLink for each main page and HeaderIconButtons and the user's avatar in actions.
DoPass your router's link as each HeaderNavLink's render, and set active on the page you're on so it is marked with aria-current.
DoGive every HeaderIconButton an aria-label, like "Notifications", and set open while its popover or menu is open so it shows orange.
DoPass unread items as count. It hides at 0, caps at 99+, and screen readers hear it as part of the button's name.
Don'tPut a library Button or IconButton on the navy bar. Use HeaderIconButton, which takes the chrome text colour and shows focus as the halo alone, as navy needs.
Don'tMark a notification read by colour alone. Set read on its NotificationRow; screen readers hear "Unread" before every title that isn't.

Props

AppHeader

PropTypeDefaultDescription
nav *ReactNode—The main navigation: HeaderNavLinks.
actionsReactNode—The actions on the right: HeaderIconButtons and the user's avatar.
navLabelstring"Main"Names the navigation for screen readers.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

HeaderNavLink

PropTypeDefaultDescription
icon *ReactNode—A 16 px icon before the label.
children *string—What it shows inside.
activebooleanfalseThe page you're on: orange at 600, with the 3 px underline.
renderReactElement<{ className?: string; children?: ReactNode }>—Your router's link, like <Link to="/contacts" />. Defaults to an <a>.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

HeaderIconButton

PropTypeDefaultDescription
icon *ReactNode—The 16 px icon it shows. Name the button with aria-label.
aria-label *string—An icon-only button has no visible text, so its name is required.
countnumber0Unread or waiting items, as a red count in the corner. Hidden at 0.
openbooleanfalseIts popover or menu is open: brand orange.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

NotificationRow

PropTypeDefaultDescription
icon *ReactNode—A 16 px icon for what happened, like a checked square for a task.
title *string—What happened, in a line, like "Ada assigned you a task".
metastring—The detail line, like "Call the vendor's solicitor · Due tomorrow".
time *string—How long ago, already worded, like "2m".
readbooleanfalseRead notifications sit on the subtle surface with a muted, regular-weight title; unread ones are announced as Unread.
onSelect() => void—Opens what it's about.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

Keyboard

The keys it answers to. Tab moves between components, arrows move within them.

KeysWhat they do
TabMoves through the links and buttons in order.
EnterFollows the focused link.
EnterSpacePresses the focused button.