Tabs

Disclosure & Layout · Guide 3 of 46

Open the live Tabs demo →

Purpose

Switches between mutually exclusive panels.

Import

<script lang="ts">
	import { Tabs } from 'bits-ui';
</script>

The registry names Tabs as this guide’s namespace. Copy the exact root and part composition from the live demo rather than guessing part names.

Usage checklist

  • Keep the reading and focus order logical with styles disabled.
  • Preserve keyboard behavior and control-to-content relationships for interactive parts.
  • Check constrained widths, overflow, and reduced-motion behavior.

Secondary reference

After using the local example, consult the upstream Bits UI reference for exhaustive API details.

Continue