Tabs
Tabs combines a selected value, triggers and panels with an animated visual indicator.
Practical React example
Switch between related views of the same record while keeping the selected view stable during rerenders.
Before you copy and paste
Keep the example in the React rendering environment required by the imported component. Copy components/motion/tabs.tsx and its returned support files from the Code tab; preserve the project-relative paths.
Listed package dependencies: clsx, motion, react, tailwind-merge.
Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.
Switch between related views of the same record while keeping the selected view stable during rerenders
// Usage adapted from beUI's pinned MIT source.
// Copyright (c) 2026 Saurabh Chauhan. See ./LICENSES.md.
"use client";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/motion/tabs";
export function TabsPreview() {
return (
<div className="flex w-full max-w-md flex-col gap-8">
<Section title="Pill">
<Tabs defaultValue="overview" variant="pill">
<TabsList>
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="activity">Activity</TabsTrigger>
<TabsTrigger value="settings">Settings</TabsTrigger>
</TabsList>
<TabsContent value="overview" className="text-sm text-muted-foreground">High-level summary.</TabsContent>
<TabsContent value="activity" className="text-sm text-muted-foreground">Recent events.</TabsContent>
<TabsContent value="settings" className="text-sm text-muted-foreground">Preferences.</TabsContent>
</Tabs>
</Section>
<Section title="Segment">
<Tabs defaultValue="day" variant="segment">
<TabsList>
<TabsTrigger value="day">Day</TabsTrigger>
<TabsTrigger value="week">Week</TabsTrigger>
<TabsTrigger value="month">Month</TabsTrigger>
</TabsList>
</Tabs>
</Section>
<Section title="Underline">
<Tabs defaultValue="all" variant="underline">
<TabsList>
<TabsTrigger value="all">All</TabsTrigger>
<TabsTrigger value="open">Open</TabsTrigger>
<TabsTrigger value="closed">Closed</TabsTrigger>
</TabsList>
</Tabs>
</Section>
</div>
);
}
function Section({ title, children }: { title: string; children: React.ReactNode }) {
return (
<div className="flex flex-col gap-2">
<span className="text-[10px] font-semibold uppercase tracking-wider text-muted-foreground">{title}</span>
{children}
</div>
);
}
Usage example adapted from beUI's pinned MIT source. Retain the source licence notices when copying.
Keep each trigger value paired with its panel value. If selection belongs in the URL, synchronize the value deliberately rather than assuming the component updates routing.
Customization
- value / onValueChange
- Use a stable string value for controlled selection. Pair each trigger value with its corresponding panel.
- variant
- Choose pill, underline or segment. This changes presentation, not the selected value.
Integration notes
- Tabs change views within a page; use links for navigation to independent destinations.
- Check arrow-key behavior, visible focus and focusable content inside inactive panels.
Component source: beUI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.
Give your agent taste.
The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.
All components are free. Sign up only to connect MCP.