{#each tabs as t, i (t.id)} {#if t.visible} {#if t.id === $selected_tab} {:else} {/if} {/if} {/each}