Sourceful Energy

Top Menu

A top navigation bar component with breadcrumbs, actions, and user menu.

Installation

import { TopMenu, TopMenuUser, TopMenuUserItem, TopMenuUserSection } from "@sourceful-energy/ui"

Usage

Examples

Simple Breadcrumbs

With Mobile Menu Button

With Left and Right Content

Last updated: 2 min ago

Props

TopMenu

PropTypeDefaultDescription
breadcrumbsBreadcrumbItem[][]Breadcrumb navigation items
showMobileMenubooleanfalseShow mobile menu button
onMobileMenuClick() => void-Mobile menu button click handler
leftContentReact.ReactNode-Left side content (appears after breadcrumbs)
rightContentReact.ReactNode-Right side content (actions, user menu, etc.)
linkComponentReact.ComponentTypeaCustom link component (e.g., Next.js Link)

TopMenuUser

PropTypeDefaultDescription
namestring-User name
emailstring-User email
avatarUrlstring-User avatar URL
avatarContentReact.ReactNode-Custom avatar content (icon, initials, etc.)
avatarClassNamestring-Avatar background color class

TopMenuUserItem

PropTypeDefaultDescription
iconReact.ReactNode-Item icon
onClick() => void-Click handler
hrefstring-Href for link items
variant"default" | "danger" | "success""default"Visual variant

Type Definitions

interface BreadcrumbItem {
  label: string
  href?: string
}