Tabs
Setup
<script lang="ts">
import { Tabs, TabItem } from "svelte-5-ui-lib";
</script>
Interactive Tab Builder
-
Profile: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<Tab>
<TabItem open title="Profile">
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Profile:</b>
Tab content
</p>
</TabItem>
<TabItem title="Dashboard">
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Dashboard:</b>
Tab content
</p>
</TabItem>
<TabItem title="Settings">
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Settings:</b>
Tab content
</p>
</TabItem>
<TabItem title="Users">
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Users:</b>
Tab content
</p>
</TabItem>
<TabItem disabled>
{#snippet titleSlot()}
<span class="text-gray-400 dark:text-gray-500">Disabled</span>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Disabled:</b>
Tab content
</p>
</TabItem>
</Tab>
Full width
-
Profile: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<script lang="ts">
import { Tabs, TabItem } from 'svelte-5-ui-lib';
</script>
<Tabs tabStyle="full" ulClass="flex flex-nowrap rounded-lg divide-x rtl:divide-x-reverse divide-gray-200 shadow dark:divide-gray-700 space-x-0">
<TabItem class="w-full" open>
{#snippet titleSlot()}Profile{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Profile:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem class="w-full">
{#snippet titleSlot()}Dashboard{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Dashboard:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem class="w-full">
{#snippet titleSlot()}Settings{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Settings:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem class="w-full">
{#snippet titleSlot()}Users{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Users:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
</Tabs>
Icon
-
Profile: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<script lang="ts">
import { Tabs, TabItem } from 'svelte-5-ui-lib';
import { UserCircleSolid, GridSolid, AdjustmentsVerticalSolid, ClipboardSolid } from "flowbite-svelte-icons";
</script>
<Tabs tabStyle="underline">
<TabItem open>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<UserCircleSolid size="md" />
Profile
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Profile:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<GridSolid size="md" />
Dashboard
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Dashboard:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<AdjustmentsVerticalSolid size="md" />
Settings
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Settings:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<ClipboardSolid size="md" />
Contacts
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Contacts:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
</Tabs>
Animated icons
-
Profile: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
<script lang="ts">
import { Tabs, TabItem } from 'svelte-5-ui-lib';
import { UserCircleFlowbite, GridFlowbite, AdjustmentsVerticalFlowbite, ClipboardFlowbite } from "svelte-animated-icons";
</script>
<Tabs tabStyle="underline">
<TabItem open>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<UserCircleFlowbite />
Profile
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Profile:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<GridFlowbite />
Dashboard
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Dashboard:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<AdjustmentsVerticalFlowbite />
Settings
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Settings:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}
<div class="flex items-center gap-2">
<ClipboardFlowbite />
Contacts
</div>
{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Contacts:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
</Tabs>
Components in tab contents
-
-
Application UI code in Tailwind CSS
Get access to over 20+ pages including a dashboard layout, charts, kanban board, calendar, and pre-order E-commerce & Marketing pages.
-
Application UI code in Tailwind CSS
All of the pages and components are first designed in Figma and we keep a parity between the two versions even as we update the project.
-
Application UI code in Tailwind CSS
Get started with dozens of web components and interactive elements built on top of Tailwind CSS.
-
<script lang="ts">
import { Tabs, TabItem, Timeline, TimelineItem, Button } from 'svelte-5-ui-lib';
import { ArrowRightOutline } from "flowbite-svelte-icons";
</script>
<Tabs>
<TabItem open>
{#snippet titleSlot()}Profile{/snippet}
<Timeline>
<TimelineItem title="Application UI code in Tailwind CSS" date="2022-02">
<p class="mb-4 text-base font-normal text-gray-500 dark:text-gray-400">Get access to over 20+ pages including a dashboard layout, charts, kanban board, calendar, and pre-order E-commerce & Marketing pages.</p>
<Button color="alternative">
Learn more
<ArrowRightOutline class="ms-2 h-5 w-5" />
</Button>
</TimelineItem>
<TimelineItem title="Application UI code in Tailwind CSS" date="2022-03">
<p class="text-base font-normal text-gray-500 dark:text-gray-400">All of the pages and components are first designed in Figma and we keep a parity between the two versions even as we update the project.</p>
</TimelineItem>
<TimelineItem title="Application UI code in Tailwind CSS" date="2022-04">
<p class="text-base font-normal text-gray-500 dark:text-gray-400">Get started with dozens of web components and interactive elements built on top of Tailwind CSS.</p>
</TimelineItem>
</Timeline>
</TabItem>
<TabItem>
{#snippet titleSlot()}Dashboard{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Dashboard:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}Settings{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Settings:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
<TabItem>
{#snippet titleSlot()}Users{/snippet}
<p class="text-sm text-gray-500 dark:text-gray-400">
<b>Users:</b>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</TabItem>
</Tabs>