Smooth Tab

SmoothTab is a client-side tab selector with an animated sliding highlight and a transitioning card area. It accepts optional tab data and notifies callers when the selected tab changes.

Smooth Tab
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @kokonutui/smooth-tab

Requires @kokonutui in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import SmoothTab from "@/components/kokonutui/smooth-tab";export function Example() {  return <SmoothTab />;}
  • Let users switch between a small set of related categories or views.
  • Show a short title and description for the currently selected option.
  • Add a visually expressive tab selector to a dashboard or product interface.

API reference

PropTypeDefaultDescription
itemsTabItem[]Four built-in tabs: Models, MCPs, Agents, and Users.Optional tab data. Each item has required `id: string`, `title: string`, and `color: string` fields, and optional `description?: string`, `icon?: LucideIcon`, `content?: React.ReactNode`, and `cardContent?: React.ReactNode` fields. The component uses `id`, `title`, `description`, `color`, and `cardContent`; `icon` and `content` are not rendered.
defaultTabIdstringThe ID of the first built-in tab, `Models`.Initial selected tab ID. This only sets the initial state; it does not update the selection after mounting.
classNamestring—Additional classes applied to the bottom tab toolbar.
activeColorstring"bg-[#1F9CFE]"Fallback class for the sliding active background when the selected item has no color. Since `color` is required on each item, that item’s `color` is normally used instead.
onChange(tabId: string) => void—Callback invoked with the selected tab ID when a tab is clicked or activated with Enter or Space.

Accessibility

  • The toolbar uses `role="tablist"`; each button uses `role="tab"`, `aria-selected`, and a tab index of 0 for the selected tab and -1 for the others.
  • Each tab's `aria-controls` points to `panel-{id}`, but the component does not render a matching element with that ID or a `tabpanel` role.
  • Enter and Space activate tabs. Arrow-key navigation is not implemented.
  • The tab buttons have a visible focus ring using `focus-visible` styles.

Docs written by openai:gpt-6-luna from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Smooth Tab" component (kokonutui/smooth-tab) from its shadcn registry.1. Install it with: npx shadcn@latest add @kokonutui/smooth-tab2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: items, defaultTabId, className, activeColor, onChange.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport SmoothTab from "@/components/kokonutui/smooth-tab";export function Example() {  return <SmoothTab />;}```

Files & dependencies

  • /components/kokonutui/smooth-tab.tsx→ components/kokonutui/smooth-tab.tsx
dependenciesmotionlucide-react

Looks similar, elsewhere