/
1.1k
Sponsor

Tabs

Tab bar with left/right arrow and tab-key navigation

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/tabs

Usage

import { Tabs } from "@/components/ui/tabs";
<Tabs
  defaultTab="general"
  tabs={[
    {
      key: "general",
      label: "General",
      content: <Text>General settings.</Text>,
    },
    {
      key: "appearance",
      label: "Appearance",
      content: <Text>Theme config.</Text>,
    },
  ]}
/>

API Reference

Tabs

PropTypeDefault
tabsTab[]required
defaultTabstring-
activeTabstring-
onTabChange(key: string) => void-
borderColorstring-
borderStyle"single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic""single"
separatorstring" │ "
tabBarPaddingXnumber2
paddingXnumber1
paddingYnumber0

Tab

PropTypeDefault
keystringrequired
labelstringrequired
contentReactNoderequired

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Arrow keys move inside the composite; Home / End select the first or last enabled item; Enter / Space activate, select, or toggle; Escape cancels or closes an owned surface; Tab / Shift+Tab move between termcn/Ink focus targets.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Ink labels and semantic state expose the component without relying on visual styling alone.