Skip to Content
Kokonut UI

NV-03Navigation

Swipe Tabs

Tabs with a swipeable panel, a drag-tracked indicator and spring physics.

Install with
motion, lucide-react

PRODocs Search and more like it are in Kokonut UI Pro

Installation

Swipe Tabs is a free, open-source React component in the Kokonut UI Navigation collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/smooth-tab.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/smooth-tab

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/smooth-tab.tsx.

npm install motion lucide-react

Usage

import SmoothTab from "@/components/kokonutui/smooth-tab";

export default function Example() {
  return <SmoothTab />;
}

Props

items
SwipeTabItem[]Default built-in
defaultTabId
string
value
string

The selected tab id, for a controlled tab. Pair it with onChange.

onChange
(tabId: string) => void
className
string

Extra classes for the root element.

activeColor
stringDefault "bg-zinc-900 dark:bg-zinc-100"

Background classes for the indicator: the one accent.

activeTextColor
stringDefault "text-white dark:text-zinc-900"

Text color classes for the label sitting on the indicator.

label
stringDefault "Sections"

Accessible name for the tab list.

SwipeTabItem

idrequired
string
titlerequired
string
icon
LucideIcon

Shown before the title in the tab.

content
ReactNode

The panel shown for this tab.

Dependencies

NeedsVersionComes from
motion^12.23.25npm, installed by the CLI
lucide-react^0.556.0npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.