ebnsina

Tabs

Navigation

About

A compound tabs component with a sliding active-tab indicator, a gliding hover highlight, roving-tabindex keyboard navigation and scroll-fade edges, for switching between panels of related content.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tabs to your project and fits it to your theme.

Code

How Tabs is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import Tabs from "@/components/ui/tabs";

// No value: the first enabled tab is selected, already in the server-rendered HTML.
export default function TabsVerticalDemo() {
  return (
    <Tabs orientation="vertical" activation="manual">
      <Tabs.List label="Ibn al-Haytham's Book of Optics">
        <Tabs.Tab value="light">Light</Tabs.Tab>
        <Tabs.Tab value="vision">Vision</Tabs.Tab>
        <Tabs.Tab value="camera">Camera obscura</Tabs.Tab>
      </Tabs.List>
      <Tabs.Panel value="light">
        Light travels in straight lines, shown by experiment rather than
        argument alone.
      </Tabs.Panel>
      <Tabs.Panel value="vision">
        We see because light enters the eye, not because the eye sends out rays.
      </Tabs.Panel>
      <Tabs.Panel value="camera">
        A dark room with a small hole projects an inverted image of the world
        outside.
      </Tabs.Panel>
    </Tabs>
  );
}

More by ebnsina

View all
  • Countdown Timer

    Countdown Timer

    28
  • Video Player

    Video Player

    20
  • Alarm Clock

    Alarm Clock

    20
  • Voice Note

    Voice Note

    13
  • Split Button

    Split Button

    11
  • Sortable List

    Sortable List

    11
  • Code Block

    Code Block

    8
  • Sign In Auth Card

    Sign In Auth Card

    7

More in Navigation

View all
  • Sidebar

    Sidebar

    311
  • Navbar with Theme Toggle

    Navbar with Theme Toggle

    47
  • Stacked Circular Footer

    Stacked Circular Footer

    436
  • Breadrcrumb

    Breadrcrumb

    8
  • Footer

    Footer

    557
  • Oversized 404 Numeral

    Oversized 404 Numeral

    63
  • Breadcrumb

    Breadcrumb

    12
  • Tabs

    Tabs

    17