Remember State
Persist toggle choices across page visits
By default, toggle state resets when you refresh the page. With persistence enabled, your choices are saved to the browser’s localStorage and restored on your next visit.
Configuration
Enable persistence in your settings:
extensions:
toggle:
output-toggle: true
persist: trueOr per-cell with #| persist: true.
```{r}
#| persist: true
print("This cell's toggle state will be remembered.")
```Try It
- Toggle the output below to hide it
- Refresh the page
- Your choice should be preserved
cat("Toggle me, then refresh the page.\n")Toggle me, then refresh the page.
cat("I'll remember whether I was hidden or shown.\n")I'll remember whether I was hidden or shown.
Clearing Saved State
Toggle states are stored in localStorage using keys like quarto-toggle-/path-cell-0. Each page maintains its own state. To reset:
- Open browser DevTools (F12)
- Go to Application → Local Storage
- Delete keys starting with
quarto-toggle-
All data stays in your browser. Nothing is sent to any server.
Summary
Use persist: true to save toggle state in the browser. Useful for documents readers visit repeatedly.