Is it possible to hide certain CMS fields when clicking a button on a page. (Sorting?)

I have a CMS based portfolio and I want to make a portfolio page showing all my work.

That I already know how to do using a basic collection list, however, I want to have three buttons on the top of my page one for each category when clicking one it will hide the other categories (I have a cms option toggle with a list of categories)

How could I achieve this?

This page hasn’t been created yet so I don’t have a link to provide

Thanks in advance

Yes with external libraries like the one here v

awesome thank you so much this looks great!