Getting StartedComponentsDesign TokensThemingTheme SynthesizerFrameworksAccessibilityUtilitiesServer RenderingBrowser SupportContributingChangelogApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip
ARC UIARC Radiant Components
v4.9DocsComponentsTokensSynthesizer
Getting StartedFrameworksServer RenderingDesign TokensThemingTheme SynthesizerTypographyUtilitiesAll ComponentsAccessibilityBrowser SupportChangelogContributingStatsApp ShellAspect GridAuth ShellCenterContainerDashboard GridFloat BarInsetMasonryPage HeaderPage LayoutResizableResponsive SwitcherSectionSettings LayoutSplit PaneStatus BarStickyToolbarAnchor NavBottom NavBreadcrumbBreadcrumb MenuCommand BarDrawerFooterLinkMenubarNavigation MenuPage IndicatorPaginationRailScroll IndicatorScroll SpyScroll To TopSidebarSkip LinkStepper NavTabsTop BarTree ViewAccordionAspect RatioAvatarAvatar GroupCardCarouselCollapsibleColor SwatchCTA BannerDividerEmpty StateFeature CardIconImageImage CompareImage HotspotsInfinite ScrollLightboxMarqueeQR CodeScroll AreaSkeletonSpinnerStackVideoVirtual ListActivity HeatmapAnimated NumberBadgeBar ListChartClockComparisonCountdown TimerData GridDescription ListDiffGaugeJSON TreeKanbanLevel MeterListMeterSparklineStatStepperTagTimelineUptimeValue CardWaveformBlockquoteCode BlockCode GroupGradient TextHighlightKbdKeyboard MapMarkdownNumber FormatProseTerminalTextTime AgoTruncateTypewriterButtonButton GroupCalendarCheckboxChipColor PickerComboboxCopy ButtonDate PickerDate Range PickerField ListFieldsetFile UploadFormHotkeyIcon ButtonImage CropperInline EditInputInput GroupKnobLabelMasked InputMulti SelectNumber InputPassword InputPin InputRadio GroupRange SliderRatingSearchSegmented ControlSelectSignature PadSliderSortable ListSwitch GroupTag InputTextareaTheme ToggleTime PickerToggleTransfer ListTree SelectAlertAnnouncementBannerCommand PaletteConfirmConnection StatusContext MenuConversationDialogDropdown MenuHover CardLoading OverlayNotification PanelPopoverProgressSheetToastTooltip

Top Bar

Fixed header bar that anchors every page with a brand slot on the left, an optional center navigation area, and a right-aligned actions region for user controls, search, and settings.

ComponentsTop Bar
navigationhybrid
<arc-top-bar>

Overview

TopBar is the persistent horizontal header that sits at the top of every page in an ARC UI application. It has three regions, brand, center and actions: logo on the left, navigation in the middle, user controls on the right. The component is designed to work hand-in-hand with AppShell and Sidebar. When nested inside an AppShell via the `top-bar` slot, it automatically spans the full viewport width and stays fixed at the top of the page while the content below scrolls. On mobile viewports, a hamburger menu button appears automatically, dispatching an `arc-sidebar-toggle` event that AppShell listens for to open or close the Sidebar overlay. Use TopBar whenever your application needs a consistent, recognizable header. It handles responsive behavior out of the box: the brand slot collapses gracefully, the center slot hides on narrow screens, and the actions slot remains accessible at every breakpoint. The `fixed` property pins the bar to the viewport so content scrolls underneath it, which is the recommended default for most dashboard and documentation layouts.

Guidelines

When to use

  • Place TopBar inside an AppShell top-bar slot for automatic fixed positioning and sidebar coordination
  • Keep the heading short: one or two words that identify the application
  • Use the logo slot to place an SVG or image mark next to the heading text
  • Put primary navigation links in the center slot for desktop layouts
  • Reserve the actions slot for user-facing controls: avatar, settings, notifications, sign-in
  • Set the fixed property when the page content is scrollable and the header should stay visible
  • Listen for the arc-sidebar-toggle event to synchronize sidebar open/close state
  • If your CSS hides every action at some width, hide `::part(actions)` in the same rule. The bar only notices an empty actions slot after it hydrates, so without it the server render and first paint keep a gap there

When not to use

  • Do not stack TopBars on one page. Use one per application shell
  • Do not put long text or paragraphs in the heading prop; it is meant for a brand name only
  • Do not place form elements or search inputs in the brand area; use the center or actions slot instead
  • Do not rely on the hamburger for primary navigation on desktop. It is hidden above 900px
  • Do not override the z-index without checking that modals and drawers still layer correctly
  • Do not leave out both the heading and the logo slot. The brand region should never be empty

Features

  • Three named slots (logo, center, actions) for flexible header composition
  • Fixed positioning mode that pins the bar to the top of the viewport
  • A hamburger button below 900px; `mobile-menu="none"` turns it off for a site with nothing to open
  • On phones the center column gives way before the brand or actions shrink; `mobile-center="end"` moves it next to the actions, `"hidden"` drops it
  • Fires `arc-sidebar-toggle` custom event for Sidebar integration
  • Brand region with accent typography, letter-spacing, and uppercase treatment
  • Works with AppShell through its top-bar slot
  • CSS custom property theming through design tokens (`--bg-deep`, `--border-subtle`, `--nav-height`)
  • Shadow DOM part attributes (topbar, brand, center, menu-btn) for external styling
  • Accessible `aria-label` and `aria-expanded` on the mobile menu toggle

Preview

Usage

Layout and styling work without JavaScript via the HTML/CSS versions. Interactive features like events and state management require the Web Component or a framework wrapper.

<script type="module" src="@arclux/arc-ui"></script>

<arc-top-bar heading="Arclight">
  <svg slot="logo" width="28" height="28" viewBox="0 0 28 28" fill="none">
    <circle cx="14" cy="14" r="13" stroke="currentColor" stroke-width="2"/>
    <path d="M9 18l5-10 5 10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <line x1="10.5" y1="15" x2="17.5" y2="15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
  </svg>
  <nav slot="center" style="display:flex;gap:24px;">
    <arc-link href="#">Dashboard</arc-link>
    <arc-link href="#">Projects</arc-link>
    <arc-link href="#">Settings</arc-link>
  </nav>
  <div slot="actions" style="display:flex;align-items:center;gap:12px;">
    <arc-icon-button name="gear" variant="ghost" size="sm" label="Settings"></arc-icon-button>
    <arc-avatar size="sm" initials="JD" aria-label="Jane Doe"></arc-avatar>
  </div>
</arc-top-bar>

API

headingstring''
Brand text displayed in the top-left corner next to the optional logo slot. Rendered uppercase with wide letter-spacing at the wordmark size. Keep this to one or two words that identify the application.
home-hrefstring'/'
Destination of the brand link. Defaults to /; set it when the app is mounted under a sub-path, or to an empty string to render the brand as plain text with no link at all.
containedstringnull
Sets a max-width containment on the top bar content area. Accepts any CSS length or named size.
mobile-menu'sidebar' | 'nav' | 'none''sidebar'
What the hamburger does below the nav-collapse breakpoint. sidebar (the default) fires arc-sidebar-toggle for an app shell's drawer; nav fires arc-mobile-menu-toggle for your own panel; none renders no hamburger, for a site with nothing to open.
menu-positionstring'left'
Position of the mobile menu panel when mobile-menu is active.
scrolledbooleanfalse
Reflects whether the page has scrolled past the bar's threshold. Set by the component, not by you. Read it to style a scrolled state from outside, via arc-top-bar[scrolled].
immersivebooleanfalse
Renders the bar with no background, blur or border until the page is scrolled, so a hero shows through it. Requires fixed. Suits marketing pages whose first screen is one composed image; leave it off in an application layout, where the bar should be a fixed edge among the other panels rather than something that appears and disappears.
fixedbooleanfalse
When true, the bar uses position: fixed so it stays at the top of the viewport while content scrolls underneath. Automatically applied when TopBar is placed inside an AppShell. Be sure to add matching top padding to the content below to prevent overlap.
menuOpenbooleanfalse
Reflects whether the mobile hamburger menu is open. Toggling this value updates the aria-expanded attribute on the menu button. Typically managed by AppShell in response to the arc-sidebar-toggle event rather than set directly.
navAlign'left' | 'center' | 'right''center'
Controls the alignment of content in the center slot. Pulls nav toward the brand or actions without reordering DOM.
mobileCenter'center' | 'end' | 'hidden''center'
Where the center slot goes below the nav-collapse breakpoint. center (the default) keeps it centered; end moves it to the right, next to the actions and the menu button; hidden removes it, for a center whose content the mobile menu already carries.

Events

eventName
arc-sidebar-toggle
Fired when the mobile menu toggle is clicked (sidebar mode)
arc-mobile-menu-toggle
Fired when the mobile hamburger button is clicked and mobile-menu mode is active. Use this to toggle your own mobile navigation panel.

See Also