Keeping a side navigation components open/close state

Coming back to this, I wanted to share that there are other options worth exploring that don’t involve a separate (sticky) LiveView.

For instance, one can save the open/close state on the client using localStorage and then pass it as params to the LiveSocket, see the example in the docs at Phoenix.LiveView.get_connect_params/1.

For a collection of this and other techniques, there’s a talk from ElixirConf EU 2025: Phoenix LiveView: Mastering Reconnects for a Seamless User Experience -Giovanni Francischelli.

1 Like