To animate a state change, you need to wrap it in withAnimation
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: