To switch to a on hover active sidebar, add data-sidenav-size="on-hover-active" to the <html> tag in your layout. You can apply this dynamically using the LayoutStoreService with setSidenavSize('on-hover-active').