Components

Tabs

Animated React tabs built on shadcn/ui and Radix: the drop-in Tabs adds a line variant, vertical layout and panels that fade in — plus Motion blocks for tabs with a gliding active indicator and direction-aware panel transitions, and an iOS-style segmented control.

  • Drop-in shadcn API
  • Radix Tabs
  • Motion layoutId
  • Keyboard accessible
  • prefers-reduced-motion

Visitors

24.8k

Signups

1,204

Conversion

4.9%

Installation

$ npx shadcn@latest add https://duskui.com/r/tabs.json

Replaces components/ui/tabs.tsx with the same parts and data-slot attributes, so existing tabs keep working. The base Tabs animates with CSS only (tw-animate-css).

Usage

settings-tabs.tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"

export function SettingsTabs() {
  return (
    <Tabs defaultValue="account">
      <TabsList>
        <TabsTrigger value="account">Account</TabsTrigger>
        <TabsTrigger value="password">Password</TabsTrigger>
      </TabsList>
      <TabsContent value="account">Edit your profile.</TabsContent>
      <TabsContent value="password">Change your password.</TabsContent>
    </Tabs>
  )
}

Examples

Default

A segmented trigger row with a raised active tab. Panels fade and rise in, and show a focus ring when reached with Tab.

Line variant

variant="line" on TabsList swaps the surface for an underline that grows from the center of the active trigger. Icons size themselves.

The rendered component, live.

Vertical

Set orientation="vertical" on Tabs for settings-style navigation. Up and Down arrows move between triggers; with the line variant the indicator becomes a side bar.

General

Workspace name, URL and default language.

Blocks

Ready-made variations composed from the base component with Motion. Each installs on its own and pulls in its dependencies automatically.

Animated Tabs

The active indicator (a pill or an underline) glides between triggers via a shared Motion layoutId, and panels slide in slightly from the direction you're travelling while the old panel leaves the other way. AnimatedTabsPanels springs to the new panel's height so nothing below jumps. Same composition as shadcn Tabs.

Visitors

24.8k

Signups

1,204

Conversion

4.9%

$ npx shadcn@latest add https://duskui.com/r/animated-tabs.json
PropTypeDefaultDescription
indicator"pill" | "underline""pill"Shape of the gliding indicator (on AnimatedTabs).
value / onValueChangestring / (value: string) => void—Controlled active tab (on AnimatedTabs).
defaultValuestring—Uncontrolled initial tab.
orientation / dir / activationModeRadix Tabs props—Forwarded to the Radix root.
AnimatedTabsList / AnimatedTabsTriggerTabsList / TabsTrigger props—The trigger row and its buttons.
AnimatedTabsPanelsdiv props—Wrap the panels: stacks them for crossfades and animates height.
AnimatedTabsContentRadix TabsContent props—A panel. Put it directly inside AnimatedTabsPanels.

Animated Tabs — underline

The same block with indicator="underline": a thin primary line slides under the active trigger. Panels of different heights resize smoothly.

$24

For teams shipping every day. Unlimited projects and preview deployments.

$ npx shadcn@latest add https://duskui.com/r/animated-tabs.json

Segmented Control

An iOS-style picker for a single value — view mode, billing period, units. A raised thumb springs between options. It is a native radio group, so arrow keys work, the value submits with forms via name, and screen readers announce it as radio buttons. Use Animated Tabs when each option shows its own panel.

View: grid

$ npx shadcn@latest add https://duskui.com/r/segmented-control.json
PropTypeDefaultDescription
options{ value, label, icon?, disabled? }[]—The segments. `icon` is an element, e.g. <List />.
value / onValueChangestring / (value: string) => void—Controlled selection.
defaultValuestringfirst optionUncontrolled initial selection.
namestring—Form field name; the selected value is submitted.
size"sm" | "default" | "lg""default"Height and text size.
fullWidthbooleanfalseStretch to the container with equal segments.
disabledbooleanfalseDisable every option.
aria-labelstring—Names the radio group. Required unless labelled elsewhere.

API Reference

Same parts as shadcn/ui: Tabs, TabsList, TabsTrigger and TabsContent, each forwarding its Radix Tabs props. The additions are below.

PropTypeDefaultDescription
variant"default" | "line""default"On TabsList: segmented surface or underline.
orientation"horizontal" | "vertical""horizontal"On Tabs: lays out the list beside the panels and switches arrow keys to Up / Down.
value / onValueChangestring / (value: string) => void—Controlled active tab (on Tabs).
activationMode"automatic" | "manual""automatic"Activate on focus, or only on Enter / Space.
tabsListVariants / tabsTriggerVariantscva—Exported class builders for custom triggers.

Accessibility

  • Built on Radix Tabs: triggers are a tablist with roving focus (arrow keys, Home, End) and panels are linked with aria-controls / aria-labelledby.
  • Panels are focusable and show a focus-visible ring, so keyboard users can Tab from the trigger into the content.
  • The gliding indicators are decorative, aria-hidden and pointer-events-none; the active state is conveyed by aria-selected.
  • Segmented Control uses native radio inputs inside a radiogroup — label it with aria-label or aria-labelledby.
  • Under prefers-reduced-motion panels only fade, the indicator jumps instead of gliding and the height change is instant.