Tabs

Tabs on Radix Tabs with a filled list or a line variant, horizontal or vertical.

Installation

pnpm dlx shadcn@latest add @ward/tabs

Add the Ward registry to components.json once:

"registries": {
  "@ward": "https://ward.so/r/{name}.json"
}

Or install from the URL with no configuration: npx shadcn@latest add https://ward.so/r/tabs.json

Usage

import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
<Tabs defaultValue="overview">
  <TabsList>
    <TabsTrigger value="overview">Overview</TabsTrigger>
    <TabsTrigger value="activity">Activity</TabsTrigger>
  </TabsList>
  <TabsContent value="overview">A summary of the project.</TabsContent>
  <TabsContent value="activity">Everything that changed lately.</TabsContent>
</Tabs>

Props

PropTypeDefaultDescription
defaultValuestring-Value of the tab that starts selected when the tabs are uncontrolled.
valuestring-Value of the selected tab, when the parent controls it.
onValueChange(value: string) => void-Called when another tab is selected.
orientation"horizontal" | "vertical""horizontal"Direction the list runs, which also sets its arrow-key navigation.
TabsList variant"default" | "line""default"Filled track with a raised active tab, or a transparent list with an underline.
TabsTrigger valuestring-Value that links the trigger to its TabsContent.
TabsContent valuestring-Value of the trigger that shows this panel.

Ward · Version 1.0.0 · Registry manifest