Tabs
A wrapper for Base UI Tabs with sliding indicator animation, line variant, vertical orientation, controlled state, and activation mode control.
Variants
Default — pill with sliding indicator animation
Manage your profile information.
Line — sliding underline indicator
Manage your profile information.
Icons
Icon + label in trigger
Profile content.
Controlled
value + onValueChange — driven by external state
Manage your profile information.
Active: profile
Orientation
orientation: vertical — list on left, content to right
Manage your profile information.
Activation mode
activateOnFocus — arrow keys activate immediately vs manual Enter/Space
Manual (default) — Enter/Space to activate
Manage your profile information.
activateOnFocus — arrow keys activate immediately
Manage your profile information.
Disabled
tab.disabled — tab cannot be selected, focus skips it
Profile content.
Installation
npx shadcn@latest add @glrk-ui/tabsIf you haven't set up the prerequisites yet, check out registry setup.
Usage
Basic
import { TabsWrapper } from "@/components/ui/tabs"
<TabsWrapper
defaultValue="profile"
tabs={[
{ value: "profile", trigger: "Profile", content: "Manage your profile." },
{ value: "account", trigger: "Account", content: "Update account settings." },
{ value: "security", trigger: "Security", content: "Change your password." },
]}
/>Variants
default uses a sliding pill indicator. line uses a sliding underline:
<TabsWrapper tabs={tabs} defaultValue="profile" variant="default" />
<TabsWrapper tabs={tabs} defaultValue="profile" variant="line" />Icons in trigger
<TabsWrapper
tabs={[
{ value: "profile", trigger: <><User /> Profile</>, content: "..." },
{ value: "settings", trigger: <><Settings /> Settings</>, content: "..." },
]}
defaultValue="profile"
/>Controlled
const [value, setValue] = useState("profile")
<TabsWrapper
tabs={tabs}
value={value}
onValueChange={setValue}
/>Orientation
<TabsWrapper tabs={tabs} defaultValue="profile" orientation="vertical" />Vertical layout places the tab list on the left and content to the right. Arrow key navigation adjusts automatically.
Activation mode
By default, arrow keys move focus and Enter/Space activates the tab. activateOnFocus activates on arrow key press immediately — no Enter needed:
<TabsWrapper tabs={tabs} defaultValue="profile" activateOnFocus />Disabled tab
<TabsWrapper
tabs={[
{ value: "profile", trigger: "Profile", content: "..." },
{ value: "account", trigger: "Account", content: "...", disabled: true },
{ value: "security", trigger: "Security", content: "..." },
]}
defaultValue="profile"
/>CSS classes
<TabsWrapper
tabs={tabs}
defaultValue="profile"
listCls="w-full"
triggerCls="flex-1"
contentCls="mt-4"
/>Per-tab override with triggerCls / contentCls on each item:
<TabsWrapper
tabs={[
{ value: "a", trigger: "Normal", content: "...", },
{ value: "b", trigger: "Special", content: "...", triggerCls: "text-primary", contentCls: "bg-muted p-4 rounded" },
]}
defaultValue="a"
/>Reference
tabItemT
Prop
Type
TabsWrapper
Prop
Type