Motion Navbar

modern react navbar with smooth animations, dropdown menus, and mobile-friendly design.

Motion Navbar will show on top of the page

Installation

npx shadcn@latest add https://scrollxui.dev/registry/motion-navbar.json 

Usage

import {
  Navbar,
  NavBody,
  NavItems,
  NavDropdown,
  MobileNav,
  NavbarLogo,
  NavbarButton,
  MobileNavHeader,
  MobileNavToggle,
  MobileNavMenu,
} from "@/components/ui/motion-navbar";
<Navbar className="bg-black dark:bg-white text-white dark:text-black">
      <NavbarLogo />
      <NavBody>
        <NavItems items={navItems} />
        <NavDropdown label="resources" items={dropdownItems} />
        <NavbarButton href="/get-started" variant="primary">
          get started
        </NavbarButton>
      </NavBody>
 
      <MobileNav>
        <MobileNavHeader>
          <MobileNavToggle isOpen={false} onClick={() => {}} />
        </MobileNavHeader>
        <MobileNavMenu>
          <NavItems items={navItems} />
          <NavDropdown label="resources" items={dropdownItems} />
          <NavbarButton href="/get-started" variant="primary">
            get started
          </NavbarButton>
        </MobileNavMenu>
      </MobileNav>
    </Navbar>
 

API Reference

Motion Navbar

modern react navbar with smooth animations, dropdown menus, and mobile-friendly design.

Props

PropertyTypeDefaultDescription
NavbarReactNode
Main navbar container that wraps all elements.
NavBodyReactNode
Holds navigation items and dropdowns (desktop view).
NavItemsarray[]
List of navigation links with labels and hrefs.
NavDropdownobject[]
Dropdown menu with grouped links and optional icons.
MobileNavReactNode
Container for mobile navigation layout.
MobileNavHeaderReactNode
Top section inside the mobile menu.
MobileNavMenuReactNode
Expandable mobile menu content area.
MobileNavToggleboolean | functionfalse
Controls open and close state of the mobile menu.
NavbarLogoReactNode
Animated brand logo for the navbar.
NavbarButtonobject
Button for primary or secondary navbar actions.
NavbarDividerReactNode
Visual divider between navbar sections.
classNamestring''
Optional Tailwind classes for styling.

Built withby Ahdeetai.