This thread might be helpful:
https://elixirforum.com/t/how-to-toggle-phoenix-modal-component-show-hide/54313/7?u=brads2s