Topbar
The header of an application screen: full width and sticky, a bottom border instead of a shadow, leading (a SidebarTrigger or a breadcrumb), centre (search or a command trigger) and trailing slots, and an optional brand. The centre collapses to `centerCompact` on narrow screens. Glass gives it a translucent chrome fill.
Example
topbar-demo.tsxCopy code
Installation
Copy code
Usage
ImportCopy code
API reference
Topbar
| Prop | Type | Default |
|---|---|---|
brandA logo or product name, before `leading`. | ReactNode | – |
leadingA SidebarTrigger or a Breadcrumb. | ReactNode | – |
centerSearch or a command palette trigger, centred. Hidden on narrow screens when `centerCompact` is set, so put only triggers here: a dialog renders where it is placed, so render it beside the Topbar, bound by its controller. | ReactNode | – |
centerCompactShown instead of `center` on narrow screens, usually an icon Button that opens the same dialog through its controller. | ReactNode | – |
trailingNotifications, appearance and the user menu. | ReactNode | – |
Also takes <header> attributes except children.
Other exports
type TopbarPropsAgent actions
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.