All components
Chewypixel component

Tabs

Underline tabs. The underline slides to the active tab and resizes to fit its label.

Chewy, fruity and rolled in a crunchy sugar shell.

Installation

npx shadcn@latest add https://chewypixel.io/r/tabs.json

Usage

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";

export function AccountTabs() {
  return (
    <Tabs defaultValue="profile">
      <TabsList>
        <TabsTrigger value="profile">Profile</TabsTrigger>
        <TabsTrigger value="billing">Billing</TabsTrigger>
        <TabsTrigger value="notifications">Notifications</TabsTrigger>
      </TabsList>
      <TabsContent value="profile">Your name, photo and bio.</TabsContent>
      <TabsContent value="billing">Your plan and invoices.</TabsContent>
      <TabsContent value="notifications">What we email you about.</TabsContent>
    </Tabs>
  );
}

Props

value

The active tab, when controlled.

string

defaultValue

The tab that starts active, when uncontrolled.

string

onValueChange

Called with the new value when the active tab changes.

(value: string) => void

Released under the MIT License.

More components

See them in a real app

These components come from Mochi, our admin dashboard template built with Next.js, shadcn/ui and Motion.