Skip to content

Conversation

@George-Madeley
Copy link

@George-Madeley George-Madeley commented Jan 5, 2026

  • I've read and followed the contributing guide on how to create great pull requests.
  • I've updated the relevant documentation for any new or updated feature.
  • I've linked relevant GitHub issue with "Closes Customization of Navigation Menu Items #4581 ".
  • I've added a visual demonstration in the form of a screenshot or video.

Summary

This PR adds support for customising the render of DashboardSidebarPageItem for child items., addressing #4581

Changes

Passed the renderPageItem function prop to DashboardSidebarSubNavigation in the renderNestedNavigation of the pageItemContextProps.

API Usage

Exactly as stated in the (docs)[https://mui.com/toolpad/core/react-dashboard-layout/#custom-page-items] but now child DashboardSidebarPageItem can now be customized. Given, the example in the documentation, to customise Sub-Item 1 and 2, a developer would do the following:

const renderPageItem = React.useCallback(
    (item: NavigationPageItem, { mini }: { mini: boolean }) => {
      ...
      if (item.title === 'Custom Item') {
        return <CustomPageItem item={item} mini={mini} />;
      }
      if  (item.segment === 'sub-item-1' {
        return <CustomPageItem item={item} mini={mini} />;
      }
      if  (item.segment === 'sub-item-2' {
        return <CustomPageItem item={item} mini={mini} />;
      }
      return <DashboardSidebarPageItem item={item} />;
    },
    [],
  );

It might be better to have the full path rather than the segment.

Documentation

No documentation required as the current documentation implies that this is already possible.

Close #4581

@mui-bot
Copy link

mui-bot commented Jan 5, 2026

Netlify deploy preview

https://deploy-preview-5130--mui-toolpad-docs.netlify.app/

Generated by 🚫 dangerJS against 4cc294a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Customization of Navigation Menu Items

2 participants