robertlib

Tabs

Navigation

About

An accessible tab bar for switching between content panels or navigating between linked pages, with an animated active indicator, keyboard navigation, closable tabs and horizontal/vertical layouts.

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

import Tabs from "@/components/ui/tabs";
import { useState } from "react";

export default function ValueTabs() {
  const [tab, setTab] = useState("overview");

  return (
    <div className="space-y-4">
      <Tabs
        items={[
          { label: "Overview", value: "overview" },
          { label: "Invoices", value: "invoices" },
          { label: "Settings", value: "settings" },
        ]}
        onChange={setTab}
        value={tab}
      />
      <p className="text-sm">
        Showing the <strong>{tab}</strong> tab.
      </p>
    </div>
  );
}

Dependencies

More by robertlib

View all
  • Timeline

    Timeline

    18
  • Chip

    Chip

    10
  • Switch

    Switch

    10
  • Empty State

    Empty State

    7
  • Spinner

    Spinner

    5
  • Progress Indicator

    Progress Indicator

    5
  • Collapsible Content

    Collapsible Content

    4
  • Checkbox

    Checkbox

    3

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    162
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    427
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    27
  • Sidebar

    Sidebar

    441
  • Tabs

    Tabs

    38
  • Footer Section

    Footer Section

    2
  • Sidebar

    Sidebar

    366
  • Pagination

    Pagination

    119