120k

Tabs

A set of layered sections of content—known as tab panels—that are displayed one at a time.

Installation

pnpm dlx shadcn@latest add @force-ui-svelte/tabs

Usage

<script lang="ts">
  import * as Tabs from "$lib/components/ui/tabs/index.js";
</script>
<Tabs.Root value="account" class="w-[400px]">
  <Tabs.List>
    <Tabs.Trigger value="account">Account</Tabs.Trigger>
    <Tabs.Trigger value="password">Password</Tabs.Trigger>
  </Tabs.List>
  <Tabs.Content value="account">
    Make changes to your account here.
  </Tabs.Content>
  <Tabs.Content value="password">Change your password here.</Tabs.Content>
</Tabs.Root>

Examples

Line

Use the variant="line" prop on Tabs.List for a line style.

Vertical

Use orientation="vertical" for vertical tabs.

Disabled

Icons

RTL

To enable RTL support in Force UI, see the RTL configuration guide.

API Reference

See the Radix Tabs documentation.