TopBar
Navigation & Chrome

TopBar

Top application bar. Holds a breadcrumb on the left and action buttons (TopBarIconButton) on the right.

Component behavior

TopBar renders an application header with location content on the left and actions on the right. The header has a fixed height of 40px and a bottom border. The application supplies navigation and state.

Use cases
  • Application headers paired with a Sidebar.
  • A left-aligned Breadcrumb with application-wide actions on the right.
  • A fixed 40-pixel header above scrolling content.
Alternatives

StatusBar: the bar belongs below content and reports connection or process state.

Toolbar: the interface represents browser controls and an address bar.

Tabs: the header switches between views of one record.

Props

breadcrumb renders directly as the first child and accepts any ReactNode. It is required. right renders in a flex container with margin-left: auto and spacing between children.

TopBarProps props
PropTypeDefaultDescription
breadcrumbReactNode—Left slot, rendered as the bar's first child with no wrapper element. A Breadcrumb by convention; any node works. Required by the type even when the bar carries only actions.
rightReactNode—Right slot. Wrapped in a flex row pushed to the far edge by margin-left: auto. Usually TopBarIconButton elements, but a Clock or a status chip also works here.

TopBarIconButton

TopBarIconButtonProps props
PropTypeDefaultDescription
iconReactNode—Icon inside a 24×24px button. The application supplies icon dimensions.
dotboolean—Displays a decorative 5px warning dot at the top-right corner. No accessible text is added.
aria-labelstring—Required accessible label for the icon-only button.

Examples

Location and actions

Place hierarchy navigation on the left and application-wide actions on the right. Use the page header for page-specific actions.

TopBar with breadcrumb and icon buttons

Location only

right is optional. Its container still renders, so the layout is unchanged: the breadcrumb appears on the left and the rest of the bar is empty. Most inner pages of an app use exactly this.

TopBar with breadcrumb only

Both slots take anything

left and right accept React content. Right-side children use an 8px gap.

TopBar with mixed slot content

In a shell column

TopBar uses flex: none and a fixed height of 40px. Tall children overflow the bar rather than increasing its height.

TopBar in an app shell
ImportTSX
import { TopBar, TopBarIconButton } from "@solarius/onset";