Skip to content

Conversation

@samueljansem
Copy link
Contributor

@samueljansem samueljansem commented Jan 21, 2026

Why These Changes Were Needed

Projects using this component library often need to customize specific inner elements (nav items styling, drawer behavior, toggle button appearance) to match their design systems. Previously, the only option was to recreate entire navigation components from scratch. These props enable granular customization while preserving default behavior.

Changes Made

  1. VerticalDrawer - Added DrawerProps to allow full Drawer customization with proper PaperProps.sx merging
  2. NavVertical - Added VerticalDrawerProps and NavToggleButtonProps
  3. NavMini - Added VerticalDrawerProps and NavToggleButtonProps, fixed LogoIcon passthrough
  4. NavHorizontal - Added VerticalDrawerProps
  5. NavCentered - Added VerticalDrawerProps
  6. NavigationLayout - Added VerticalDrawerProps and NavToggleButtonProps, exposing them as the public API

Usage Examples

// Customize the mobile drawer
<NavigationLayout
  navData={navData}
  VerticalDrawerProps={{
    anchor: 'right',
    PaperProps: { sx: { backgroundColor: 'grey.100' } },
  }}
/>

// Customize the toggle button
<NavigationLayout
  navData={navData}
  NavToggleButtonProps={{
    sx: { top: 32 },
    color: 'primary.darker',
  }}
/>

// Customize NavItem styles
<NavigationLayout
  navData={navData}
  slotProps={{
    rootItem: {
      backgroundColor: 'primary.main',
    },
  }}
/>

Jira Issue: https://silverlogic.atlassian.net/browse/BA-3028

Summary by CodeRabbit

  • New Features

    • Navigation components (vertical, horizontal, mini, centered) now accept slotProps and drawer customization props for richer styling and slot overrides.
    • NavMini and NavVertical accept toggle-button customization props for button styling/behavior.
    • Vertical drawer supports additional drawer and paper properties (merged with existing styles).
    • NavigationLayout forwards these customization options to all navigation variants.
  • Chores

    • Package version updated and changelog added.

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

⚠️ No Changeset found

Latest commit: d466da2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

Navigation components and types now accept and forward new customization props (slotProps, VerticalDrawerProps, NavToggleButtonProps) down the component tree; VerticalDrawer gained a DrawerProps prop to pass through Material-UI Drawer and Paper props.

Changes

Cohort / File(s) Summary
Navigation Component Implementations
packages/components/modules/navigations/web/NavCentered/index.tsx, packages/components/modules/navigations/web/NavHorizontal/index.tsx, packages/components/modules/navigations/web/NavMini/index.tsx, packages/components/modules/navigations/web/NavVertical/index.tsx
Components now destructure slotProps and VerticalDrawerProps (plus NavToggleButtonProps for Mini/Vertical) and forward them to children. Small-screen branches pass DrawerProps={VerticalDrawerProps} to VerticalDrawer; desktop sections receive slotProps.
Navigation Component Types
packages/components/modules/navigations/web/NavCentered/types.ts, packages/components/modules/navigations/web/NavHorizontal/types.ts, packages/components/modules/navigations/web/NavMini/types.ts, packages/components/modules/navigations/web/NavVertical/types.ts
Added optional props to interfaces: slotProps?: SlotProps, VerticalDrawerProps?: Partial<DrawerProps>; NavMini and NavVertical also add NavToggleButtonProps?: Partial<IconButtonProps>. Imports updated for DrawerProps, IconButtonProps, and SlotProps.
Top-Level Layout
packages/components/modules/navigations/web/NavigationLayout/index.tsx, packages/components/modules/navigations/web/NavigationLayout/types.ts
NavigationLayout signature and props interface extended to accept slotProps, VerticalDrawerProps, and NavToggleButtonProps, and these props are propagated to Nav variants.
Shared Drawer Component
packages/components/modules/navigations/web/__shared__/VerticalDrawer/index.tsx, packages/components/modules/navigations/web/__shared__/VerticalDrawer/types.ts
VerticalDrawer accepts DrawerProps?: Partial<DrawerProps>; implementation extracts PaperProps and spreads remaining DrawerProps onto the underlying Drawer, merging PaperProps.sx with existing styles.
Package & Changelog
packages/components/CHANGELOG.md, packages/components/package.json
Bumped package version to 1.5.0 and added changelog entry describing navigation customization additions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested labels

approved

Suggested reviewers

  • priscilladeroode
  • anicioalexandre
  • deboracosilveira
  • Hercilio1

Poem

🐰 Props hop down the nav tree bright and spry,
Slot whispers, Drawer tweaks, Button wings to try,
PaperProps mingle, drawers open wide,
Components pass carrots with careful pride,
Hooray — a crumb trail for customization! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change—adding slot props and customization options to navigation components—and is directly related to the changeset.
Description check ✅ Passed The description includes all required template sections with comprehensive context, detailed changes, and usage examples, meeting the repository's documentation standards.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/components/modules/navigations/web/NavCentered/types.ts`:
- Around line 9-10: NavCenteredProps declares slotProps but NavigationLayout's
render path doesn't forward slotProps to the NavCentered component while it does
for NavHorizontal/NavMini/NavVertical; update the NavigationLayout/index.tsx
render branch that returns <NavCentered ...> to include the slotProps prop (pass
the same slotProps variable used for other navs), or if the centered layout
truly shouldn't accept slotProps remove slotProps from the NavCenteredProps type
in packages/components/modules/navigations/web/NavCentered/types.ts and any
related usages to keep the API consistent.

In `@packages/components/modules/navigations/web/NavigationLayout/index.tsx`:
- Around line 50-55: NavCentered is missing the slotProps prop—add
slotProps={slotProps} to the NavCentered JSX so it receives the same slotProps
passed to NavHorizontal, NavMini, and NavVertical; locate the NavCentered
component usage in NavigationLayout (the instance with navData, openNav,
onCloseNav, VerticalDrawerProps) and include slotProps to match NavCenteredProps
type and ensure consistent behavior.
🧹 Nitpick comments (2)
packages/components/modules/navigations/web/__shared__/VerticalDrawer/index.tsx (1)

26-30: Consider adding dependency array entry for onCloseNav.

The effect depends on pathname but calls onCloseNav. While onCloseNav is likely stable, the exhaustive-deps rule would flag this. If linting is enforced, consider wrapping onCloseNav in a ref or adding it to deps with appropriate memoization upstream.

packages/components/modules/navigations/web/NavVertical/index.tsx (1)

51-51: Consider merging sx prop for consistency with NavMini.

In NavMini, NavToggleButton merges the sx prop explicitly to allow custom positioning overrides:

sx={{ top: 22, left: NAV_WIDTH.MINI - 12, ...NavToggleButtonProps?.sx }}

Here, the spread {...NavToggleButtonProps} relies on NavToggleButton's internal sx merge. This works because NavToggleButton already spreads sx internally, but the pattern is inconsistent between components.

@sonarqubecloud
Copy link

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.

2 participants