Skip to main content

Navbar

The Navbar component provides a responsive navigation header with support for branding, navigation links, collapsible content, and different positioning modes.

Import​

import { Navbar } from "@promethey/bsui";

Note

Navbar inherits all utility props supported by the Prime component, including layout, spacing, typography, colors, borders, sizing, positioning, and other Bootstrap utility APIs.

Basic usage​

Responsive​

Use expand together with Navbar.Toggler and Navbar.Collapse to create responsive navigation.

Brand​

Use Navbar.Brand for displaying application names, logos, or brand elements.

Navbar.Nav groups navigation items inside the navbar.

Tone​

Use the tone prop to change navbar appearance.

Placement​

Navbar supports fixed and sticky positioning.

Scrollable navigation​

Use Navbar.Nav with scroll to enable scrollable navigation content.

Avatar​

Combine Navbar, Dropdown, and Nav.Link to create a user profile menu with an avatar. This pattern is commonly used for account actions such as profile settings, notifications, and sign out.

Dark​

Apply the dark tone together with a dark background to create navigation bars suitable for dashboards, admin panels, and applications with dark themes.

Login​

All utility props provided by Prime are supported.

API​

PropTypeDefaultDescription
childrenReactNode—Navbar content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
tone"light" | "dark"—Navbar color variant.
expand"sm" | "md" | "lg" | "xl" | "xxl"—Responsive collapse breakpoint.
placement"fixed-top" | "fixed-bottom" | "sticky-top"—Navbar positioning mode.
PropTypeDefaultDescription
childrenReactNode—Brand content.
tostring"#"Navigation target.
aselementType"a"Rendered HTML element.
PropTypeDefaultDescription
childrenReactNode—Collapsible content.
classNamestring—Additional CSS classes.
styleobject—Inline styles.
PropTypeDefaultDescription
childrenReactNode—Navigation content.
scrollbooleanfalseEnables scrollable navigation.
scrollHeightstring—Maximum scroll height.
PropTypeDefaultDescription
childrenReactNode—Button content.
onClickfunction—Click callback.
PropTypeDefaultDescription
childrenReactNode—Text content.
classNamestring—Additional CSS classes.