• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
  • Global Configuration
    • Environment Variables
    • Feature Flags
  • Server Actions
    • Sending CSRF Token to Actions
    • Server Actions Error Handling
  • The Makerkit SDK
    • User SDK
    • Organization SDK
    • Organization Subscription SDK
    • Data Loader SDK
  • Architecture and Folder Structure
    • Structure your Application
    • Data Model
    • Adding API Routes
    • Change Authentication strategy
    • Fetching the signed in User
    • Reading Records from Postgres
    • Creating a Record
    • Seeding Local Data
    • Introduction
    • Configuring Plans
    • Project Configuration
    • Updating the Navigation menu
    • Adding a new translation string
    • Supabase is not starting
    • Calling API Routes from the client
    • Adding Pages
    • Updating the Sidebar menu
    • Setup oAuth
    • Fetching the selected Organization
    • Resetting the local DB
    • Running the Stripe Webhook locally
    • Branding
    • Setting a Default Language
    • Supabase is not stopping
    • Dark Theme
    • Theming
    • API Routes vs Server Actions
    • Generating Database Types
    • Updating the Logo
    • Adding a new language in the Next.js Supabase SaaS Kit
    • Tables/Functions not found
    • Updating the Fonts
    • Adding Pages
    • Adding a new translation file
    • Contentlayer gets stuck
    • Guarding Pages
    • Using Lemon Squeezy instead of Stripe
    • Updating the Favicons
    • Using the Language Switcher
    • Dynamic server usage error
    • Environment variables
    • Detect current Locale
    • 403 error with API/Actions
    • Setting up Emails
This documentation is for a legacy version of Next.js and Supabase. For the latest version, please visit the Next.js and Supabase V2 documentation

Updating the sidebar menu of your Makerkit SaaS application

Learn how to update the sidebar menu of your Makerkit landing pages

The Sidebar of your Makerkit SaaS application is defined in the src/navigation.config.tsx configuration file.

This allows you to easily add, remove, or update the menu entries of your application and automatically generate a responsive sidebar menu for your users.

Adding a new menu entry to the Sidebar

To add a new menu entry to the sidebar, simply add a new entry to the NAVIGATION_CONFIG.items array in the src/navigation.config.tsx file.

A menu entry is defined by the following properties:

tsx
{
label: string;
path: string;
Icon: (props: { className: string }) => JSX.Element;
}
  • label: The label of the menu entry. This label will be displayed in the sidebar of your application. This can be either a reference to a translation key or a string.
  • path: The path of the menu entry. This path will be used to generate the href attribute of the menu entry.
  • Icon: The icon of the menu entry. This icon will be displayed in the sidebar of your application.

Consider the default schema below:

tsx
import configuration from '~/configuration';
import {
Cog8ToothIcon,
Square3Stack3DIcon,
Squares2X2Icon,
} from '@heroicons/react/24/outline';
const NAVIGATION_CONFIG = (organization: string) => ({
items: [
{
label: 'common:dashboardTabLabel',
path: getPath(organization, configuration.paths.appHome),
Icon: ({ className }: { className: string }) => {
return <Squares2X2Icon className={className} />;
},
},
{
label: 'common:tasksTabLabel',
path: getPath(organization, 'tasks'),
Icon: ({ className }: { className: string }) => {
return <Square3Stack3DIcon className={className} />;
},
},
{
label: 'common:settingsTabLabel',
path: getPath(organization, 'settings'),
Icon: ({ className }: { className: string }) => {
return <Cog8ToothIcon className={className} />;
},
},
],
});
function getPath(organizationId: string, path: string) {
const appPrefix = configuration.paths.appPrefix;
return [appPrefix, organizationId, path].filter(Boolean).join('/');
}
export default NAVIGATION_CONFIG;

Now, let's add a new menu entry to the sidebar:

tsx
import configuration from '~/configuration';
import {
Cog8ToothIcon,
Square3Stack3DIcon,
Squares2X2Icon,
} from '@heroicons/react/24/outline';
const NAVIGATION_CONFIG = {
items: [
{
label: 'common:dashboardTabLabel',
path: configuration.paths.appHome,
Icon: ({ className }: { className: string }) => {
return <Squares2X2Icon className={className} />;
},
},
{
label: 'common:tasksTabLabel',
path: '/tasks',
Icon: ({ className }: { className: string }) => {
return <Square3Stack3DIcon className={className} />;
},
},
{
label: 'common:settingsTabLabel',
path: '/settings',
Icon: ({ className }: { className: string }) => {
return <Cog8ToothIcon className={className} />;
},
},
{
label: 'common:myNewTabLabel',
path: '/my-new-tab',
Icon: ({ className }: { className: string }) => {
return <Cog8ToothIcon className={className} />;
},
},
],
};

As you can see, we added a new menu entry to the NAVIGATION_CONFIG.items array. The change will be automatically reflected in the sidebar of your application.