Dokumentation (english)
Components: Shadcn UI

Tabs

Understand the design system and contribute to it

Component preview

The live preview for UI components is handled by components/atoms/codedocs/ComponentPreview.tsx. Use it directly inside MDX whenever you want a playground-style embed. Provide componentProps to set default values and propOptions to surface toggle-able props next to the preview.

Preview
Keep track of key metrics, release health, and teammate progress.

Prop reference

Auto-generated from the component source

Tabs

  • className

React.ComponentProps<typeof TabsPrimitive.Root>

TabsContent

  • className

React.ComponentProps<typeof TabsPrimitive.Content>

TabsList

  • className

React.ComponentProps<typeof TabsPrimitive.List>

TabsTrigger

  • className

React.ComponentProps<typeof TabsPrimitive.Trigger>

Code
// owner: Sona
"use client";

import * as React from "react";

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

export default function TabsExample() {
  const [value, setValue] = React.useState("overview");

  return (
    <Tabs value={value} onValueChange={setValue} className="w-full max-w-xl">
      <TabsList>
        <TabsTrigger value="overview">Overview</TabsTrigger>
        <TabsTrigger value="activity">Activity</TabsTrigger>
        <TabsTrigger value="billing">Billing</TabsTrigger>
      </TabsList>
      <TabsContent
        value="overview"
        className="rounded-lg border p-4 text-sm text-muted-foreground"
      >
        Keep track of key metrics, release health, and teammate progress.
      </TabsContent>
      <TabsContent
        value="activity"
        className="rounded-lg border p-4 text-sm text-muted-foreground"
      >
        Aggregated deploys, incidents, and audit events in one place.
      </TabsContent>
      <TabsContent
        value="billing"
        className="rounded-lg border p-4 text-sm text-muted-foreground"
      >
        Manage invoices, seats, and usage-based add-ons.
      </TabsContent>
    </Tabs>
  );
}

On this page


Command Palette

Search for a command to run...

Schnellzugriffe
STRG + KSuche
STRG + DNachtmodus / Tagmodus
STRG + LSprache ändern

Software-Details
Kompiliert vor 15 Tagen
Release: v4.0.0-production
Buildnummer: master@6fbd7b5
Historie: 13 Items