Adjust tabs

This commit is contained in:
Steve Kinney
2024-10-02 03:19:52 -05:00
parent 265c6255a8
commit 1708a4c5c4
2 changed files with 8 additions and 12 deletions

View File

@@ -1,16 +1,10 @@
<script>
import { onMount } from 'svelte';
/** @type {Array<{ title: string, content: string, id?: string }>} */
export let tabs = [];
let tabbedContent = null;
let activeIndex = 0;
const isSelected = (index) => index === activeIndex;
const getTabIndex = (index) => (isSelected(index) ? 0 : -1);
</script>
<section bind:this={tabbedContent}>
<section>
<div role="tablist">
{#each tabs as tab, i}
{@const id = tab.id || i}