Skip to content
GitHub (opens in a new tab)

AppHeader

Product top chrome: brand mark, centred search and trailing actions.

stableOrganismcontracts/appheader.json

Preview

AppHeader

Product top chrome. Letter mark or a logo slot on the start, kit Input search in the center, kit Buttons on the end. Not PageHeader. Not DocsNav.

Master

Full-bleed bar. Default mark is a letter, same idea as SideNav. Search is kit Input.

Acme

Usage

Use for the product shell top bar. Pass logo for a custom mark — do not bake a brand SVG into the kit. Page titles stay on PageHeader. Sidebars stay on SideNav or DocsNav.

Do's

  • Persistent product shell top bar with logo, global search, and utility actions
  • A full-bleed header above the page, not the page’s title block

Don'ts

<AppHeader
  title="Acme"
  mark="A"
  searchPlaceholder="Search"
  searchShortcut="⌘K"
  actions={
    <>
      <Button appearance="ghost" mode="neutral" size="sm" iconStart="Bell" ariaLabel="Notifications" />
      <Button appearance="ghost" mode="neutral" size="sm" iconStart="CircleHelp" ariaLabel="Help" />
    </>
  }
/>

Component variables

Override on :root, a wrapper, or the component's className / style, e.g. .myHeader { --appheader-height: var(--space-12); }. Set them to semantic tokens, never hex. Listed under cssVars in the contract.

VariableControls (default)
--appheader-heightMinimum bar height (calc(space-10 + space-2 + space-2))
--appheader-padding-inlineBar end padding and the stacked-search inset; the start stays 0 so the brand lines up with the SideNav rail (space-5 wide, space-4 in narrow containers)
--appheader-gapGap between the start, center and end columns (space-4)
--appheader-backgroundBar background (surface-card)
--appheader-border-colorBottom border colour, or the full border with radius md (border-faint)
--appheader-brand-widthColumn the default mark centers in (default: --sidenav-width-collapsed, then layout-sidebar-compact). Set --sidenav-width-collapsed on :root and the brand column follows; set this only to break the match
--appheader-title-sizeProduct title size (type-size-heading). Set a smaller type size token, e.g. type-size-ui-lg, for a quieter brand; the app-shell example does
--appheader-search-max-widthMax width of the center column (layout-rail); the column also stays within 40% of the bar
--appheader-search-min-widthMin width of the center column before the bar stacks (12rem, capped at the column)

Product top chrome: brand mark on the start, centered kit Input search, trailing actions. Not a page title. Not a sidebar.

When to use

  • Persistent product shell top bar with logo, global search, and utility actions
  • A full-bleed header above the page, not the page’s title block

When not to use

  • Page title, subtitle, Breadcrumb, or in-page actions — use PageHeader
  • Vertical sidebar catalog — use DocsNav
  • Closeable product side nav — use SideNav
  • Horizontal site destinations and dropdowns — use NavigationMenu
  • Command palette overlay — use Command; AppHeader search is a kit Input

What an agent reads

import { AppHeader } from "agentic-ds-kit";
must
  • header has aria-label from ariaLabel, title, or Application
  • Search is kit Input type=search with aria-label from searchPlaceholder
  • Default letter mark is aria-hidden
  • Mark sits in a layout-sidebar-compact slot, centered, so it shares the SideNav icon axis in layout-shell
  • Actions remain keyboard accessible
  • Do not use h1 — page titles belong on PageHeader
  • At container 38rem, search stacks under brand and actions
  • Slots replace a region only; the header landmark and its aria-label stay
  • Built headers keep the landmark: AppHeader.Root is the only <header>; pass ariaLabel
  • AppHeader.Actions is a labelled group; AppHeader.Search keeps the Input's accessible name
defaults
  • search true
  • searchPlaceholder Search
  • radius none
stops if
  • Do not invent TopBar, SearchBar, Logo, Masthead, or AppBar cousins
  • Do not use PageHeader for product chrome
  • Do not leave a gap between AppHeader and SideNav — compose layout-shell over layout-app, both radius none
  • Do not pad the mark independently of layout-sidebar-compact — it must stay centered on SideNav icons
  • Do not use DocsNav, SideNav, or NavigationMenu as a top bar with search
  • Do not bake a product logo SVG into the kit — use logo or mark
  • Do not add a Copilot, assistant, or sparkle CTA
  • Do not restyle kit Input internals
  • Do not put more than one primary Button in actions
  • Do not use raw hex
  • Do not set component variables to raw hex or primitive --color-* ramps — use semantic tokens
  • Do not hand-roll a header bar, brand cell, or search field around the compose parts — compose AppHeader.Root and its parts
  • Do not put compose parts outside AppHeader.Root, or more than one center part in one Root
  • Do not use h1–h6 for AppHeader.Title

From contracts/appheader.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
titlestringNo—Product name next to the mark. Not an h1. Page titles belong on PageHeader.
markstringNo—Brand letter. Defaults to the first character of title. Same idea as SideNav mark. Not a branded SVG.
markIconKitIconNo—Icon mark instead of the letter, on the same brand fill and rail-axis cell: a Lucide name (e.g. Receipt), a Lucide component, or an element. Used when logo is omitted. Same prop on SideNav, so the two marks match. A real logo goes in logo.
logoslotNo—Custom mark or wordmark ReactNode. Replaces the default letter mark. Consumers pass their own logo. Do not copy a file-specific brand mark into the kit.
searchbooleanNotrueRenders a centered kit Input. Hide only when the shell has no global search. The center column is at least --appheader-search-min-width (12rem) and at most --appheader-search-max-width or 40% of the bar, and the actions keep their width, so search never runs into them; below 38rem it stacks under the bar.
searchPlaceholderstringNoSearch—
searchValuestringNo—controlled. When set, pair with onSearch.
defaultSearchValuestringNo——
onSearchfunctionNo—(value: string) => void. Input onChange.
searchShortcutstringNo—Decorative Input end slot, e.g. ⌘K. Not a keybinding.
searchIdstringNo—Passed to kit Input. Generated when omitted.
actionsslotNo—kit Buttons. At most one primary. Do not put an assistant/Copilot CTA in the kit.
startslotNo—Replaces the start region (default: brand mark or logo, then title). title still names the header landmark. If you host it in the app-shell example (add app-shell) with a props header, start also replaces the Menu Button the shell injects as logo: put AppShellMenuButton inside your start.
centerslotNo—Replaces the center region (default: the search Input when search is true). null leaves the center empty. Stacks under start and end in narrow containers, like search.
endslotNo—Replaces the end region (default: actions). Rendered in a group labelled Actions. At most one primary Button.
classNamestringNo——
ariaLabelstringNo—header label. Defaults to title, then Application.
radiusmd | noneNononeBar corners. none is a flush full-bleed bar. md is radius-surface-md for an inset floating bar.
  • Component
    →

    Breadcrumb

    Path to the current page as a hierarchy of links.

  • Component
    →

    PageHeader

    Top-of-page title with optional Breadcrumb trail, subtitle, actions, page Tabs, a profile Avatar and a decorative cover.

  • Component
    →

    DocsNav

    Docs and catalog sidebar only: title, grouped text-only links, optional decorative icons and muted counts on group and subgroup headers only, an active page pill and optional footer links.

  • Component
    →

    SideNav

    Product side nav: brand header, icon items, optional badges, closeable; variant single (one column that closes to an icon rail) or rail-subnav (a fixed icon rail plus a SideNav.SubNav column with the picked parent's rows).