If you need toggles to be open by default when the page loads, you can use the solution below. The code can be used either in the custom code section for the entire website or on individual pages.
Open toggles by default
Recommended Notion setup
For best results, structure your Notion page using toggle blocks.
Supported toggle heading levels:
- Toggle Heading 1
- Toggle Heading 2
- Toggle Heading 3
- Toggle Heading 4
- Toggle Default Heading
Installation instructions
- Open your site in the Super Dashboard.
- Open the Code section.
- To make toggles default open across the whole site, add the code at the site level.
- To make toggles default open on one specific page only, add the code at the page level.
- In the Head tab, paste the stylesheet
- In the Body tab, paste the JavaScript.
- Save your changes.
- Open your live Super site and refresh the page.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/super-so/super-so.github.io@master/toggles/toggle.css"><script src="https://cdn.jsdelivr.net/gh/super-so/super-so.github.io@master/toggles/toggle.js"></script>Notes and limitations
- It does not change the original toggle state in Notion. It only changes how the toggles display on the website.
- The code depends on Super/Notion toggle class names. If those class names change, the code may need an update.
- Pages with many toggles, heavy custom code, or third-party scripts may need extra testing.
Troubleshooting
- If the toggle arrow looks wrong, check that the CSS was added correctly.
- If the code only works on some pages, test it on a simple page with a few toggles first.
- If toggles stop working after moving between pages, the script may need to re-run after page navigation.