Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Navbar

Brand, navigation and actions with a real responsive toggle.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Choose a surface, blend into the page, or use a floating frame. The transparent appearance avoids side edges caused by an inset background.

Open preview

Brand, links and actions; the active link is marked for assistive technology.

Open preview

Both examples use the same Navbar API. Open the menu to see links and actions; selecting a link closes it. The layout responds to the navbar's own width.

Open preview

Usage

Compose NavbarBrand, NavbarContent, NavbarItem and NavbarActions. Enable collapsible and include NavbarToggle for narrow containers. Choose appearance=surface, transparent or floating; bordered controls the bottom divider while floating keeps its surrounding frame.

NavbarToggle accepts custom icon and closeIcon nodes. Control open/onOpenChange when route changes or another part of your app should close the menu.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluNavbarProps

Type source
PimoluNavbarProps public API
NameTypeDefaultDescription
appearance"surface" | "transparent" | "floating" | undefinedsurface; transparent inherits the page backgroundSurface treatment. Defaults to surface; transparent inherits the page background.
stickyboolean | undefinedfalseStick to the top of the scroll container.
borderedboolean | undefinedtrueDraw the bottom border. Defaults to true.
itemsPosition"left" | "right" | "center" | undefined"left"Alignment of the navigation items inside the bar. Defaults to "left". The brand stays at the start and the actions at the end.
collapsibleboolean | undefinedfalseCollapse links and actions behind NavbarToggle in narrow containers.
openboolean | undefined—Controlled mobile menu state.
defaultOpenboolean | undefinedfalseInitial mobile menu state when uncontrolled.
onOpenChange((open: boolean) => void) | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
appearance

"surface" | "transparent" | "floating" | undefined

Default: surface; transparent inherits the page background

Surface treatment. Defaults to surface; transparent inherits the page background.

sticky

boolean | undefined

Default: false

Stick to the top of the scroll container.

bordered

boolean | undefined

Default: true

Draw the bottom border. Defaults to true.

itemsPosition

"left" | "right" | "center" | undefined

Default: "left"

Alignment of the navigation items inside the bar. Defaults to "left". The brand stays at the start and the actions at the end.

collapsible

boolean | undefined

Default: false

Collapse links and actions behind NavbarToggle in narrow containers.

open

boolean | undefined

No default extracted.

Controlled mobile menu state.

defaultOpen

boolean | undefined

Default: false

Initial mobile menu state when uncontrolled.

onOpenChange

((open: boolean) => void) | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluNavbarBrandProps

Type source
PimoluNavbarBrandProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
typestring | undefined"button"Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLAnchorElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLAnchorElement> | undefined—Standard React/HTML attribute.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

type

string | undefined

Default: "button"

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLAnchorElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLAnchorElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluNavbarContentProps

Type source
PimoluNavbarContentProps public API
NameTypeDefaultDescription
aria-labelstring | undefined—Accessible name of the navigation landmark.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
aria-label

string | undefined

No default extracted.

Accessible name of the navigation landmark.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluNavbarToggleProps

Type source
PimoluNavbarToggleProps public API
NameTypeDefaultDescription
iconReactNode—Replaces the default hamburger icon.
closeIconReactNode—Replaces the default close icon.
openLabelstring | undefined"Open menu"Accessible label while the menu is closed.
closeLabelstring | undefined"Close menu"Accessible label while the menu is open.
onChangeChangeEventHandler<HTMLButtonElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLButtonElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefinedfalseStandard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
type"submit" | "reset" | "button" | undefined"button"Standard React/HTML attribute.
valuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
icon

ReactNode

No default extracted.

Replaces the default hamburger icon.

closeIcon

ReactNode

No default extracted.

Replaces the default close icon.

openLabel

string | undefined

Default: "Open menu"

Accessible label while the menu is closed.

closeLabel

string | undefined

Default: "Close menu"

Accessible label while the menu is open.

onChange

ChangeEventHandler<HTMLButtonElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLButtonElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

Default: false

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

type

"submit" | "reset" | "button" | undefined

Default: "button"

Standard React/HTML attribute.

value

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

PimoluNavbarItemProps

Type source
PimoluNavbarItemProps public API
NameTypeDefaultDescription
activeboolean | undefinedfalsePublic Pimolu prop; see the source declaration for details.
disabledboolean | undefinedfalsePublic Pimolu prop; see the source declaration for details.
iconReactNode—Decorative icon displayed before the link label.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
typestring | undefined"button"Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLAnchorElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLAnchorElement> | undefined—Standard React/HTML attribute.
active

boolean | undefined

Default: false

Public Pimolu prop; see the source declaration for details.

disabled

boolean | undefined

Default: false

Public Pimolu prop; see the source declaration for details.

icon

ReactNode

No default extracted.

Decorative icon displayed before the link label.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

type

string | undefined

Default: "button"

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLAnchorElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLAnchorElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluNavbarActionsProps

Type source
PimoluNavbarActionsProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Give navigation a useful accessible name and use real href destinations.
  • Keep open/close labels clear when replacing the hamburger icon. active items identify the current page.
Read the accessibility guide →