Phoenix LiveView v0.20.4 introduced a new feature called JS.toggle_class/1, which allows for easy class toggling on DOM elements. This feature is versatile and can be used for basic visibility toggling, toggling multiple elements at once, and toggling animations.
•5m read time• From fly.io
Table of contents
Basic visibilityToggle multiple elements at onceToggle with animationsDynamic items in a listReusing the click eventDiscussionSort: