{$activeClass = 'tw-shadow-theme-xs tw-text-gray-900 tw-dark:text-white tw-bg-white tw-dark:bg-gray-800'}
<div class="tw-inline-flex tw-w-full tw-items-center tw-gap-0.5 tw-rounded-lg tw-bg-gray-100
tw-p-0.5 tw-dark:bg-gray-900 tw-dark:text-white/60">
    {foreach $cases as $case}
        <button onclick="ui.switchGroup(this, '{$activeClass}');{$jsCallback|default:''}"
                {if isset($case[2])}
                    hx-get="{$case[2]}"
                    hx-target="#pageSpeedContainer"
                    hx-swap="innerHTML"
                {/if}
                class="tw-text-theme-sm tw-w-full tw-rounded-md tw-px-3 tw-py-2 tw-font-medium
                tw-hover:text-gray-900 tw-dark:hover:text-white{if $case[0] === $activeOffset} {$activeClass}{/if}">
            {$case[1]}
        </button>
    {/foreach}
</div>
