Since Svelte 5.16 you can now pass objects and arrays to the class attribute on elements, making it much easier to dynamically assign classes:

https://svelte.dev/docs/svelte/class#Attributes-Objects-and-arrays

Very handy!

Comments