Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Tabs

Panel switching with roving arrow-key focus, taken from @zag-js/tabs.

import { Tabs } from "@/components/ui/tabs";
const panels = [
{ label: "Settings", value: "schedule", content: "Manage workspace settings." },
{ label: "Activity", value: "hadir", content: "Review member activity." },
];
<Tabs items={panels} defaultValue="schedule" />
Terminal window
npx @glaceon/cli add tabs --framework react # or svelte, solid
Element Data Attribute Value Description
trigger data-selected "" The active tab. This machine emits data-selected, not data-state="active".
trigger data-disabled "" Present when the tab cannot be chosen.
trigger data-focus "" The tab holds focus.
trigger data-orientation "horizontal" | "vertical" Layout axis.
trigger data-value string The tab’s value.
content data-selected "" The visible panel.
Prop Type Default Description
items { label: string, value: string, content: string }[] required Tabs and their panels.
defaultValue string first item The tab selected on first render.
class / className string undefined Extra classes for the root, appended last.
contentClass string undefined Extra classes for each panel.
Key Description
Tab Moves focus into the tab list, landing on the selected tab.
ArrowLeft / ArrowRight Moves between tabs, following focus.
Home / End Jumps to the first or last tab.