Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelogContact
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCountry SelectCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputEmoji PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone SelectTree Select
Forms
Address InputBooking WidgetCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverShare DialogSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSetup ChecklistSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadar chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX EditorDOCX ViewerExcel ViewerFile SystemImage compareImage CropperImage GalleryImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadChat WidgetConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Background PatternGravity LettersMarqueeTerminalText AnimateText Rotate
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Marketing Sections
App Download SectionBlog Cards SectionCTA SectionFAQ SectionFeature GridFeature ShowcaseHero SectionIntegrations SectionLogo CloudMarketing FooterMarketing HeaderMarketing SectionNewsletter SectionPricing SectionStats SectionSteps SectionTeam SectionTestimonials SectionTimeline SectionVideo Section
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAPI Keys PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowOrder History PagePost Listing WizardPricing PageProfile PageRegister PageSettings PageUsers Admin Page
Templates
About PageAcademy PageAccessibility PageAffiliate PageAgency PageAI Product PageAppointment Booking PageBlog PageBlog Post PageBug Bounty PageCareers PageChangelog PageCommunity PageCompare PageContact PageCustomer Story PageCustomers PageDemo Booking PageDevelopers PageDocs Home PageDownload PageEnterprise PageEvents PageExperts PageFAQ PageFeature PageGlossary PageHelp Article PageHelp Center PageHome Services PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePortfolio PagePress PageProduct Tour PagePromo PageReal Estate PageReferral PageResearch Report PageRestaurant PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageStorefront PageSwitch PageTemplate Gallery PageTravel PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Navigation

Topbar

Navigation

Topbar React component for Tailwind CSS v4

TabsUser Menu
Live props
Content
title
titleAs
Appearance
size
background
border
Layout
mobileTitleAlign
sticky
safeArea
Behavior
hideOnScroll
menuButton
menuShortcut
menuControls
State
menuOpen
Code
import { Topbar } from "@/components/ui/topbar"

<Topbar />
  1. Home
  2. Components
  3. Navigation
  4. Topbar
Pro

Topbar React component for Tailwind CSS v4

v1.0.0·Added in 1.0.0

A React top bar for app headers: menu button, title or breadcrumb, a search in the middle and actions at the end, on a sticky glass bar.

Scroll the page and a hairline fades in under the glass bar. On a phone the bar slides away as you scroll down, following your finger, and comes straight back the moment you scroll up, at the top and at the end of the page; tabbing into a hidden bar springs it back, and it never hides while focus is inside it. Inside an app shell the menu button opens the drawer on phones (the two lines cross into an X) and collapses the sidebar on desktop, with a tooltip that shows the shell's shortcut (Cmd/Ctrl+B by default). Tab moves through the menu button, the title links, the search and the actions. On phones the title is centered on the screen and the search folds into an icon next to the actions.

Topbar is a Pro React component in the React navigation components category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add topbar, together with Button, Tooltip, useMediaQuery, useScrollState, useShortcut and 3 more and the npm packages motion and lucide-react.

Add to a project

Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup

npx wingo-ui@latest add topbar

Topbar is part of Pro, with 298 more Pro items: $8 a month or $150 once. 14-day refund before you download any Pro item. See plans

Usage

Import Topbar from @/components/ui/topbar.

"use client"

import { useState } from "react"
import { Bell, Search } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Topbar } from "@/components/ui/topbar"

export function ClientsHeader() {
  const [menuOpen, setMenuOpen] = useState(false)
  return (
    <Topbar
      title="Clients"
      titleAs="h1"
      menuButton="always"
      menuOpen={menuOpen}
      onMenuClick={() => setMenuOpen((open) => !open)}
      actions={
        <>
          <Button variant="ghost" size="icon" radius="full" aria-label="Search">
            <Search />
          </Button>
          <Button variant="ghost" size="icon" radius="full" aria-label="Notifications">
            <Bell />
          </Button>
        </>
      }
    />
  )
}

Props

  • titledefault ""
    ReactNode

    Text or a breadcrumb. Truncates when there is no room; with no title the bar holds start and actions only.

  • mobileTitle
    ReactNode

    A shorter title below 768px, usually the breadcrumb's last entry.

  • titleAsdefault "div"
    "div" | "h1" | "h2" | "span"

    The title element. Use h1 only when the page has no other.

  • start
    ReactNode

    After the menu button: a logo, a back button, a workspace switcher.

  • center
    ReactNode

    The middle: a global search, a CommandMenuTrigger, a segmented switch. Below 768px it moves next to the actions, so give it a compact phone form (both do: an icon).

  • actions
    ReactNode

    The end: notifications, the user menu, buttons. Icon buttons: ghost, size icon, radius full.

  • sizedefault "md"
    "sm" | "md" | "lg"

    Bar height 48 / 56 / 64px plus the top safe area; the title grows with it.

  • backgrounddefault "blur"
    "blur" | "solid" | "transparent"

    blur: frosted glass over the page. solid: the page background. transparent: nothing until content scrolls under it, then glass (a header over a hero photo). The bar reads --bar-bg for the surface it sits on.

  • borderdefault "scrolled"
    "scrolled" | "always" | "never"

    The bottom hairline: fades in once content scrolls under the bar, always there, or never.

  • mobileTitleAligndefault "center"
    "start" | "center"

    Below 768px. center puts the title in the middle of the screen like iOS, not between uneven buttons.

  • stickydefault true
    boolean

    Pins the bar to the top of its scroll container (sticky top-0). Off, it scrolls away with the page and never hides.

  • safeAreadefault true
    boolean

    Pads env(safe-area-inset-top) for notched phones. It is 0 in desktop browsers, so the default is harmless.

  • hideOnScrolldefault "mobile"
    "never" | "mobile" | "always"

    Slides the bar away while scrolling down, following the finger, and brings it back on scroll up; mobile does it below 768px only. Snaps after scrolling stops; under reduced motion it flips instead of sliding.

  • menuButtondefault "auto"
    "auto" | "always" | "never"

    auto: inside an app shell (useNavShell) the hamburger on phones and the sidebar toggle on desktop; outside one, nothing. always: also outside a shell, a hamburger that calls onMenuClick. never: no menu button. For custom headers use TopbarMenuButton (see Parts), the same toggle alone.

  • menuShortcutdefault "mod+b"
    string

    The sidebar shortcut shown in the toggle's tooltip and set as aria-keyshortcuts. Display only: the shell binds it. "" hides it.

  • menuOpendefault false
    boolean

    Outside a shell: your drawer is open. The hamburger turns into an X and reports aria-expanded. In the playground it applies with menuButton="always", which drops the demo's app shell.

  • onMenuClick
    () => void

    Called by the menu button. Outside a shell it is the only thing the button does (open your own drawer).

  • menuControlsdefault ""
    string

    The id of the drawer or sidebar the menu button controls, set as aria-controls.

  • scrollTarget
    HTMLElement | Window | RefObject<HTMLElement | null> | null

    What scrolls, for the hairline and hide on scroll. Default: the nearest ScrollContainerProvider, else the window.

  • labels
    { openMenu?: string; closeMenu?: string; collapse?: string; expand?: string }

    The menu button's aria-labels and tooltip. Default: the shell's labels, else "Open menu", "Close menu", "Collapse sidebar", "Expand sidebar".

  • classNames
    Partial<Record<"inner" | "start" | "title" | "center" | "actions" | "menuButton", string>>

    Extra classes for the inner parts.

  • className
    string

    Extra classes for the <header>, merged last. The bar sets data-scrolled, so text-white data-scrolled:text-foreground styles a header over a photo. Set [--bar-bg:var(--surface)] on a card.

Parts

  • TopbarMenuButton

    component

    The hamburger / sidebar toggle on its own, for custom headers. Inside an app shell it drives the shell; outside one it calls onClick. Takes every Button prop except children and asChild (variant ghost, size icon and radius full by default).

    • kinddefault "auto"
      "auto" | "hamburger" | "sidebar"

      auto: inside a shell a hamburger on phones and the sidebar toggle on desktop, outside one a hamburger. hamburger and sidebar force the look.

    • open
      boolean

      Outside a shell: the drawer it opens is open, so the hamburger turns into an X.

    • controls
      string

      The id of the drawer or sidebar it controls, for aria-controls.

    • shortcutdefault "mod+b"
      string

      The sidebar shortcut shown in the tooltip and set as aria-keyshortcuts. Display only; the shell binds it.

    • tooltipdefault true
      boolean

      The tooltip on the desktop sidebar toggle.

    • labels
      TopbarLabels

      openMenu, closeMenu, collapse and expand aria-labels.

  • TopbarLabels

    type

    The labels object: { openMenu?, closeMenu?, collapse?, expand? }, shared by Topbar and TopbarMenuButton.

Examples

Minimal

A title and one action; the hairline appears once the list scrolls.

Transparent over a photo

background="transparent" until content scrolls under it, then glass; data-scrolled flips the text color.

Phone detail page

Centered title, a back button in start, and the bar sliding away as you scroll down.

Large, with tabs under it

size="lg"; the tabs stick at var(--topbar-offset) and ride up as the bar hides.

Command menu in the middle

The search pattern: a field on desktop, an icon on phones.

Solid with a border

background="solid" and border="always" for forms and settings.

Your own drawer

Outside an app shell, menuButton="always" + onMenuClick; the lines cross into an X while it is open.

Dependencies

motionlucide-reactbuttontooltipuse-media-queryuse-scroll-stateuse-shortcutmotionnavigationui-config

Files

  • components/ui/topbar.tsx

FAQ

Is the React Topbar component free?

The preview, props and docs are free; copying the source needs a Pro plan. See plans.

How do I install Topbar?

Run npx wingo-ui@latest add topbar. It also adds the Wingo UI items it builds on (Button, Tooltip, useMediaQuery, useScrollState, useShortcut and 3 more) and the npm packages motion and lucide-react. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/topbar.

How does Topbar behave on phones?

On a phone the bar slides away as you scroll down, following your finger, and comes straight back the moment you scroll up, at the top and at the end of the page; tabbing into a hidden bar springs it back, and it never hides while focus is inside it.

See also

App ShellSidebarBreadcrumbLarge Title HeaderBottom Tab BaruseScrollStatehook

Used in

App ShellAdmin Shell

More React navigation components

Workspace SwitcherScroll ProgressProximity SidebarBounce SidebarHook SidebarGooey Nav
All 19 React navigation components
PreviousTabsNext User Menu
NNorthwind CRM
  • Home
  • Inbox4
  • Clients
  • Offers12
  • Invoices
  • Reports
  • Settings
Clients
  1. Home
  2. Clients
SS

Clients

30 clients · scroll the list to see the bar react

hideOnScroll="mobile" · scrolled: false · inside an app shell · press SS to search (the site keeps /Slash), CtrlBControl B toggles the sidebar

  • TI

    Tech Solutions Inc.

    New York · 12-345678

    $12,480.00
  • SL

    Summit Logistics

    Boston · 12-353597

    $4,199.00
  • EL

    Emma Carter LLC

    Seattle · 12-361516

    $7,918.00Overdue
  • GP

    Greenleaf Pharmacy

    Portland · 12-369435

    $11,637.00
  • KB

    Keystone Builders

    Denver · 12-377354

    $15,356.00
  • OB

    Old Mill Bakery

    Buffalo · 12-385273

    $19,075.00
  • DC

    Dental Art Clinic

    Miami · 12-393192

    $22,794.00
  • WB

    Westside Books

    Austin · 12-401111

    $2,513.00
  • NL

    North Studio LLC

    New York · 12-409030

    $6,232.00
  • SP

    Studio Pixel

    Seattle · 12-416949

    $9,951.00Overdue
  • GR

    Green House Realty

    Austin · 12-424868

    $13,670.00
  • B

    Bistro 21

    Chicago · 12-432787

    $17,389.00
  • DL

    Delta Farms LLC

    Omaha · 12-440706

    $21,108.00
  • CI

    Cascade Furniture Inc.

    Tacoma · 12-448625

    $827.00
  • SL

    Showcase Design LLC

    Dallas · 12-456544

    $4,546.00
  • TB

    Tech Solutions · New York branch

    New York · 12-464463

    $8,265.00
  • SB

    Summit Logistics · Boston branch

    Boston · 12-472382

    $11,984.00Overdue
  • EB

    Emma Carter · Seattle branch

    Seattle · 12-480301

    $15,703.00
  • GB

    Greenleaf Pharmacy · Portland branch

    Portland · 12-488220

    $19,422.00
  • KB

    Keystone Builders · Denver branch

    Denver · 12-496139

    $23,141.00
  • OB

    Old Mill Bakery · Buffalo branch

    Buffalo · 12-504058

    $2,860.00
  • DB

    Dental Art Clinic · Miami branch

    Miami · 12-511977

    $6,579.00
  • WB

    Westside Books · Austin branch

    Austin · 12-519896

    $10,298.00
  • NB

    North Studio · New York branch

    New York · 12-527815

    $14,017.00Overdue
  • SB

    Studio Pixel · Seattle branch

    Seattle · 12-535734

    $17,736.00
  • GB

    Green House Realty · Austin branch

    Austin · 12-543653

    $21,455.00
  • BB

    Bistro 21 · Chicago branch

    Chicago · 12-551572

    $1,174.00
  • DB

    Delta Farms · Omaha branch

    Omaha · 12-559491

    $4,893.00
  • CB

    Cascade Furniture · Tacoma branch

    Tacoma · 12-567410

    $8,612.00
  • SB

    Showcase Design · Dallas branch

    Dallas · 12-575329

    $12,331.00