Svelte Collapsible Card Component
DIY height transitions
There is a nice css-tricks article that explains a technique for getting a collapsible card to work, it is linked at the bottom of the article. The strategy is to allow the element height to be variable by default
I took the logic from this article and translated it into a Svelte component with all of the awesome code-reducing features of the reactive framework. The result is demonstrated in the REPL linked below.