sabo/src/components/dashboard/nav-main.tsxsabo/src/components/dashboard/nav-secondary.tsxsabo/src/components/dashboard/nav-user.tsxsabo/src/components/dashboard/nav-projects.tsx
When to use
- Build structured menus grouped by purpose (main vs secondary vs user vs projects).
Usage
These components are used insideapp-sidebar.tsx:
src/components/dashboard/app-sidebar.tsx
Key features
- NavMain: Collapsible navigation with icons and nested sub-items
- NavSecondary: Simple link list for support/feedback type links
- NavUser: User profile dropdown in sidebar footer
- NavProjects: Project/workspace quick switcher
Customization
1
Configure nav-main items
Edit the
items prop in app-sidebar.tsx. Each item supports:title- Display texturl- Target routeicon- Lucide React icon componentisActive- Whether to highlight (computed from pathname)items- Array of sub-items for collapsible menus
2
Add nav-secondary links
Simple flat links for support, feedback, or external resources:
3
Wire nav-projects
Quick links to projects or workspaces:
4
Handle external links
For external URLs (e.g., docs, changelog), use full
https:// URLs. The nav components will detect and render them with appropriate target="_blank" attributes.Troubleshooting
- Sub-items not showing
- Ensure parent item has
itemsarray populated
- Ensure parent item has
- Active state not working
- Check
isActiveis computed correctly usingusePathname()
- Check
- External links opening in same tab
- Verify URL starts with
http://orhttps://
- Verify URL starts with