To enable the boxed layout, add data-layout-width="boxed" to the <html> tag. For optimal spacing and usability, we also recommend adding data-sidenav-size="on-hover" to make the sidebar compact while keeping more room for content. You can apply this dynamically using the LayoutStoreService with setLayoutWidth('boxed') and setSidenavSize('on-hover') respectively.