This commit shows it https://github.com/john-hamnavoe/baccus/commit/bf604db4d57064cd0ef1b71f93d273f82ac61035
Look at the menu_group components in the project. Use excid3 stimulis components to toggle. The component will check bath to see if it should be expanded (so when page refresh happens it does not disappear). Shared folder has sidebar html/erb file.