Hi,
I want to minimize the sidebar by default, I've tried many things and it didn't work. How should I update my config?
import type LayoutConfigTypes from "@/layouts/default-layout/config/types";
const config: LayoutConfigTypes = {
general: {
mode: "system",
primaryColor: "#50CD89",
pageWidth: "default",
layout: "light-sidebar",
iconsType: "outline",
},
header: {
display: true,
default: {
container: "fluid",
fixed: { desktop: false, mobile: false },
menu: { display: true, iconType: "keenthemes" },
},
},
sidebar: {
display: true,
default: {
minimize: {
desktop: { enabled: true, default: false, hoverable: true },
},
menu: { iconType: "keenthemes" },
},
},
toolbar: {
display: true,
container: "fluid",
fixed: { desktop: false, mobile: false },
},
pageTitle: { display: true, breadcrumb: true, direction: "column" },
content: { container: "fluid" },
footer: {
display: true,
container: "fluid",
fixed: { desktop: false, mobile: false },
},
illustrations: { set: "sketchy-1" },
scrolltop: { display: true },
};
export default config;
thnx, this worked
Hi,
Thank you for reaching out to us.
To make sidebar minimized by default follow the steps below:
1) Navigate demo1/src/core/services/LayoutService.ts and in function initSidebar
add the following code, which will add attribute data-kt-app-sidebar-minimize="on"
on body tag to hide sidebar.
this.bodyStore.addBodyAttribute({
qualifiedName: "data-kt-app-sidebar-minimize",
value: "on",
});
active
class on the sidebar toggle button.