App shell

Topbar

The 44px bar above a page: breadcrumbs on the left, page actions on the right. Inside an AppFrame it adds the phone menu button that opens the sidebar drawer.

Edited 2m ago

Usage

  • Use it as the topbar of an AppFrame to show where the user is and the actions for the current page.
  • Keep actions few; on phones the “Edited” label, Copy link and Favorite are hidden and only the current crumb is shown.
  • App screens: pass your own actions (or none: the right side stays empty). Document pages: opt into the document actions with edited, onShare, onCopyLink, onFavorite and moreSlot.
  • Don’t use it as a site header with primary navigation; put navigation in the Sidebar.

Installation

Install the package (React 19):

terminal
npm install @krackedui/motion

Import the styles once, in your app entry or root layout:

/src/main.tsx
import '@krackedui/motion/styles.css';

Use it anywhere inside your app's <Theme> (see Installation):

/src/TopbarExample.tsx
import { Topbar, TopbarButton, BreadcrumbTrail } from '@krackedui/motion';

export function TopbarExample() {
  // Document actions are opt-in: each one shows when its prop is set.

  return (
    <Topbar
      breadcrumbs={<BreadcrumbTrail items={[{ title: 'Team wiki' }, { title: 'Q4 roadmap', icon: '🗺️' }]} />}
      edited="Edited 2m ago"
      onShare={() => console.log('Share')}
      onCopyLink={() => console.log('Copy link')}
      favorite={false}
      onFavorite={() => console.log('Favorite')}
      moreSlot={<TopbarButton icon="ellipsis" label="Actions" iconSize={22} tone="primary" />}
    />
  );
}

Examples

Collapsed sidebar and favorite

Custom actions

Composition

anatomy
<Topbar breadcrumbs actions>        // header, 44px
  breadcrumb region → [menu button < 768px] · [» when collapsed] · <BreadcrumbTrail items privacy/>
  actions           → your own `actions` (built from <TopbarButton/> or Button), or
                      opt-in document actions (<TopbarActions/>): Edited · Share · Copy link · Favorite · Actions (moreSlot),
                      each shown only when its prop is set; nothing by default
</Topbar>

API Reference

Topbar

Based on <header>. Adds:

PropTypeDefault
breadcrumbs
ReactNode
edited
ReactNode | null
actions
ReactNode
sidebarCollapsed
boolean
onOpenSidebar
() => void
onSidebarPeek
(peeking: boolean) => void
menuButton
boolean
true
idle
boolean
false
favorite
boolean
onShare
() => void
onCopyLink
() => void
onFavorite
() => void
moreSlot
ReactNode

Based on <div>.

PropTypeDefault
items
Crumb[]
privacy
ReactNode | null
"Private"
onPrivacyClick
() => void
label
string
"Breadcrumb"

TopbarButton

Based on <button>. 28x28, radius 6.

PropTypeDefault
icon
IconName
label
string
iconSize
number
20
tone
"primary""secondary"
"secondary"
tooltip
ReactNode

TopbarActions

The document action cluster on its own (e.g. as a peek's actions). Each control renders only when its prop is set; with none it renders nothing.

PropTypeDefault
edited
ReactNode | null
favorite
boolean
onShare
() => void
onCopyLink
() => void
onFavorite
() => void
moreSlot
ReactNode

Accessibility

  • Rendered as header. BreadcrumbTrail is a nav "Breadcrumb" with an ordered list; the last crumb has aria-current="page".
  • Inside an AppFrame on phones, the "Open sidebar" menu button opens the drawer (aria-expanded); focus returns to it when the drawer closes.
  • Every icon button has an aria-label and a tooltip; Favorite exposes aria-pressed.
  • With idle, the bar fades out but comes back on hover and on keyboard focus (focus-within).
  • Pass a Menu.Trigger as moreSlot so the Actions button opens a keyboard-navigable menu.
© 2026 Motion. Internal documentation.