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
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
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