Selected State for Filter Menu Buttons

Hey there,

I added a filter menu like described in this video.
Now I want to add a selected state for the buttons in the filter menu. Can someone help me with that?

Have a nice evening, Simon

Inside the loop, you can conditionally add a class when the filter is action

<?php foreach ($filters as $filter): ?>
  <a <?= $filter === get('category') ? 'class="active"' : '' ?> href="<?= $page->url() . '?category=' . $filter ?><?= $filter ?></a>
<?php endforeach ?>

Thank you very much. It worked!