Sprintify Navigation

raw JSON →
1.0.15 verified Sat May 09 auth: no python

A navigation widget library for PySide6-based applications. Provides a sidebar or top-bar navigation component with material design styling. As of version 1.0.15, the package is stable with occasional updates. Requires Python >=3.6 and PySide6. The library is actively maintained on GitHub.

pip install sprintify-navigation
error ModuleNotFoundError: No module named 'sprintify_navigation'
cause The package is installed as sprintify-navigation but imported with underscore. Ensure the import statement matches the correct name.
fix
Use pip install sprintify-navigation; the import is from sprintify_navigation.
error AttributeError: 'NavigationWidget' object has no attribute 'add_item'
cause Using an older version (pre-1.0.0) where method was named addItem.
fix
Upgrade to >=1.0.15 and use add_item.
error ImportError: cannot import name 'NavigationWidget' from 'sprintify-navigation'
cause Trying to import from the dash-separated package name, which is invalid.
fix
Use from sprintify_navigation import NavigationWidget (underscore).
gotcha The add_item method requires a callable callback; passing an integer or string will crash silently.
fix Ensure the third argument to add_item is a callable (e.g., lambda or function reference).
gotcha Icon paths are relative to the working directory, not the module. Failing to resolve absolute paths will show broken images.
fix Use os.path.abspath or pass QIcon directly with absolute path.
deprecated In version 1.1.0 (not yet released), the constructor signature may change to accept a themes argument. Deprecated in current docs.
fix Do not rely on undocumented constructor parameters; use setter methods after instantiation.

Creates a main window with a navigation widget. Replace placeholder icon paths and callbacks as needed.

import sys
from PySide6.QtWidgets import QApplication, QMainWindow, QStackedWidget
from sprintify_navigation import NavigationWidget

app = QApplication(sys.argv)
window = QMainWindow()
stack = QStackedWidget()

nav = NavigationWidget()
# Example: add items with text and icon
nav.add_item("Home", "home_icon.png", lambda: stack.setCurrentIndex(0))
nav.add_item("Settings", "settings_icon.png", lambda: stack.setCurrentIndex(1))

window.setCentralWidget(nav)
window.show()
sys.exit(app.exec())