New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@b7r/react-navbar

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@b7r/react-navbar

This project is a flexible and customizable navigation bar built with React and Tailwind. It includes interactive components like dropdown menus.

1.1.8
latest
Source
npm
Version published
Maintainers
0
Created
Source

react-navbar

This project is a flexible and customizable navigation bar built with React and Tailwind. It includes interactive components like dropdown menus.

Installation

npm install @b7r/react-navbar
npx add-navbar

Usage

import { 
  Navbar, 
  NavbarLogo, 
  NavbarContent, 
  NavbarMenu, 
  NavbarTrigger 
} from '@b7r/react-navbar';

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <Navbar variant="default" sticky>
      <NavbarContent>
        <NavbarLogo href="/">
          <span>Logo</span>
        </NavbarLogo>
      </NavbarContent>

      <NavbarContent className="hidden md:flex">
        <a href="/features">Features</a>
        <a href="/pricing">Pricing</a>
        <a href="/about">About</a>
      </NavbarContent>

      <NavbarContent className="md:hidden">
        <NavbarTrigger onClick={() => setIsOpen(!isOpen)}>
          <svg>...</svg>
        </NavbarTrigger>
      </NavbarContent>

      <NavbarMenu show={isOpen} className="md:hidden">
        <div className="flex flex-col gap-4">
          <a href="/features">Features</a>
          <a href="/pricing">Pricing</a>
          <a href="/about">About</a>
        </div>
      </NavbarMenu>
    </Navbar>
  );
}

Components

Navbar

The root component that wraps all navbar elements.

Props:

  • variant: 'default' | 'transparent' | 'colored'
  • sticky: boolean
  • className: string

Component for the navbar logo/brand.

Props:

  • href: string (optional)
  • className: string
  • children: ReactNode

NavbarContent

A container for navbar items.

Props:

  • className: string
  • children: ReactNode

NavbarMenu

Mobile-responsive menu container.

Props:

  • show: boolean
  • className: string
  • children: ReactNode

NavbarTrigger

Mobile menu trigger button.

Props:

  • onClick: () => void
  • className: string
  • children: ReactNode

Customization

The components use Tailwind CSS classes and can be customized using the className prop:

<Navbar className="custom-navbar">
  {/* ... */}
</Navbar>

License

MIT

Keywords

react-nav

FAQs

Package last updated on 13 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts