Svelte toggle class for a group of buttons

Hi I have a svelte app with a group of buttons for selecting content. I want the clicked button to receive the active class and all other buttons in the group to receive the inactive class.
I want the above group to be independent of any other buttons on the page.
How would I do this in svelte?
Any help much appreciated.

Found this repl - answers my question.