Inside your docusaurus.config.js, you need to add the parameter hideableSidebar: true, in the themeConfig category.
EXAMPLE
(module.exports = { // start of the module.export declaration
[…]
themeConfig: {
hideableSidebar: true,
[…]
}
[…]
}); // end of the module-export declaration
REFERENCE