Skip to content

Commit

Permalink
[core] Allow changing the width of the drawer in dashboard layout com…
Browse files Browse the repository at this point in the history
…ponent
  • Loading branch information
garryxiao committed Oct 21, 2024
1 parent b78e92a commit 4fd1760
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export interface DashboardLayoutProps {
* @default false
*/
hideNavigation?: boolean;
/**
* The width in pixel of the sidebar when expanded, default value is 320.
*/
sidebarExpandedWidth?: number;
/**
* The components used for each slot inside.
* @default {}
Expand Down Expand Up @@ -121,6 +125,7 @@ function DashboardLayout(props: DashboardLayoutProps) {
disableCollapsibleSidebar = false,
defaultSidebarCollapsed = false,
hideNavigation = false,
sidebarExpandedWidth = 320,
slots,
slotProps,
sx,
Expand Down Expand Up @@ -286,7 +291,7 @@ function DashboardLayout(props: DashboardLayoutProps) {

const getDrawerSharedSx = React.useCallback(
(isMini: boolean, isTemporary: boolean) => {
const drawerWidth = isMini ? 64 : 320;
const drawerWidth = isMini ? 64 : sidebarExpandedWidth;

return {
width: drawerWidth,
Expand Down

0 comments on commit 4fd1760

Please sign in to comment.