Skip to content
MoonUIMoonUI
ComponentsTemplatesPricing
Sign inGet started

Getting started

  • Introduction
  • Installation
  • CDN
  • Authentication
  • shadcn CLI
  • MCP Server
  • Usage

Components

Foundation25 components
  • Alert
  • Aspect Ratio
  • Avatar
  • Badge
  • Button
  • Button Group
  • Checkbox
  • File Upload
  • Input
  • Kbd
  • Label
  • Radio Group
  • Rating
  • Select
  • Slider
  • Switch
  • Textarea
  • Toggle
  • Toggle Group
  • Separator
  • Tags Input
  • Color Picker
  • Date Picker
  • Simple Editor
  • Input OTP
Layout10 components
  • Accordion
  • Breadcrumb
  • Card
  • Carousel
  • Collapsible
  • ResizablePro
  • Scroll Area
  • StepperPro
  • Table
  • Tabs
Navigation & Overlays11 components
  • Alert DialogPro
  • Command
  • Context MenuPro
  • Dialog
  • Dropdown Menu
  • Hover CardPro
  • MenubarPro
  • Pagination
  • Popover
  • SheetPro
  • Tooltip
Feedback4 components
  • Progress
  • Skeleton
  • Spinner
  • Toast
Data & Analytics4 components
  • Data TablePro
  • Advanced ChartPro
  • DashboardPro
  • WidgetsPro
Navigation4 components
  • Command AI+Pro
  • SidebarPro
  • NavbarPro
  • Navigation MenuPro
AI Chat4 components
  • MessagePro
  • Message ScrollerPro
  • AttachmentPro
  • Conversation MarkerPro
Content Management6 components
  • Advanced FormsPro
  • Form WizardPro
  • Quiz FormPro
  • Credit Card InputPro
  • Phone Number InputPro
  • Rich Text EditorPro
Project Management3 components
  • KanbanPro
  • TimelinePro
  • CalendarPro
Performance & Utility8 components
  • Virtual ListPro
  • Memory Efficient DataPro
  • Lazy ComponentPro
  • Optimized ImagePro
  • Performance MonitorPro
  • Performance DebuggerPro
  • Error BoundaryPro
  • Health CheckPro
Interactive & Animation15 components
  • Animated NumberPro
  • Floating DockPro
  • Text RevealPro
  • Image ComparePro
  • Splash CursorPro
  • GitHub StarsPro
  • Animated ButtonPro
  • Magnetic ButtonPro
  • Magnetic ElementsPro
  • Mouse TrailPro
  • Hover Card 3DPro
  • Spotlight CardPro
  • Floating Action ButtonPro
  • LightboxPro
  • Media GalleryPro
Gesture & Touch7 components
  • Swipeable CardPro
  • Draggable ListPro
  • Pinch ZoomPro
  • Swipe ActionsPro
  • Gesture DrawerPro
  • Click AnimationsPro
  • Touch GesturesPro
Text Animations12 components
  • Text HighlighterPro
  • Typewriter TextPro
  • Scrambled TextPro
  • Word RotatePro
  • Morphing TextPro
  • Flip TextPro
  • Number TickerPro
  • Glitch TextPro
  • Shiny TextPro
  • Wavy TextPro
  • Gradient TextPro
  • Text 3DPro
Animations12 components
  • Animated ListPro
  • Bounce EffectPro
  • Blur FadePro
  • Elastic AnimationPro
  • MarqueePro
  • Parallax ScrollPro
  • Reveal CardsPro
  • Scroll RevealPro
  • Fade TransitionsPro
  • Focus TransitionsPro
  • Path AnimationsPro
  • SVG AnimationsPro
Layouts1 components
  • Bento GridPro
Effects9 components
  • ConfettiPro
  • Cursor TrailPro
  • Glow EffectPro
  • Pixel ImagePro
  • Neon EffectPro
  • ShimmerPro
  • RipplePro
  • SparklesPro
  • SpotlightPro
Backgrounds17 components
  • Grid PatternPro
  • MeteorsPro
  • Aurora BackgroundPro
  • ParticlesPro
  • StarfieldPro
  • Dot PatternPro
  • Grid DistortionPro
  • WavesPro
  • Matrix RainPro
  • Liquid BackgroundPro
  • Mesh GradientPro
  • Glitch BackgroundPro
  • Gradient FlowPro
  • Floating ElementsPro
  • Bubble BackgroundPro
  • Geometric PatternsPro
  • Code SnippetsPro
Special UI1 components
  • Glow CardPro
Showcase8 components
  • iPhone MockPro
  • Android MockPro
  • Safari MockPro
  • GlobePro
  • Dotted MapPro
  • Icon CloudPro
  • Tweet CardPro
  • File TreePro

Advanced

  • Theming
  • Customization
  • CLI
  • Help & Support
  1. Docs
  2. Components
  3. Tabs

Tabs

Free + Pro

A set of layered sections of content—known as tab panels—that are displayed one at a time. Pro version includes dynamic tab management, advanced animations, state persistence, and more.

Pro

What Pro adds to Tabs

The free tabs is MIT-licensed. The Pro version builds on it with:

  • 8 style variants (pills, underline, cards, gradient, glassmorphism, neon)
  • 6 animation modes (fade, slide, scale, flip, morph)
  • Dynamic tab management (add, remove, reorder)
See pricing

Pro features

What the Pro version adds to this component.

  • Premium Style Variants

    8 distinctive styles including pills, underline, gradient, glassmorphism, and neon

  • Advanced Animations

    6 animation modes for smooth transitions between tab panels

  • Dynamic Management

    An items array your app can drive, closeable tabs, an add affordance, and drag-along-the-strip reordering — every change reported through onTabsChange

  • Smart Features

    State persistence, URL sync, keyboard shortcuts, and horizontal/vertical orientation

Installation

Install via CLI

npx @moontra/moonui-cli add tabs

Usage

Basic Usage

Pro required

Content for tab 1

Pro Usage

Pro
Pro required

Examples

Basic Tabs

Simple tabs with content panels

With Icons

Tabs with icons for better visual hierarchy

Variants & Sizes

Style tabs with the built-in CVA props: TabsList variant, TabsTrigger variant/size, the icon & iconPosition props, fadeTabs, and animated content

Vertical Orientation

Settings-style layouts where the labels are long and the panel is tall: set orientation="vertical" on the root only — TabsList and TabsTrigger read it from context, so arrow-key direction and layout always agree (a child can still override it locally)

Pro
Pro examples

Advanced Animations

Pro

Rich animations with multiple variants

Pro required

Closeable Tabs (items API)

Pro

Editor-style workspaces where the user opens and dismisses views. Describe the tabs with the items array and turn on closeable — the component renders the close control itself, as a properly labelled button next to the tab (never nested inside it), and keeps a pinned tab open with closeable: false. size="sm" keeps a long tab strip compact. Here the component owns the strip after the first render and reports every dismissal through onTabClose / onTabsChange; the next example shows the opposite arrangement, where the array lives in your state and the component follows it

Pro required

Parent-Controlled Tabs (items)

Pro

The opposite arrangement: the tab array lives in your own state and the component follows it. Push a new items array — one more tab, a renamed one, one fewer — and the strip updates. The comparison is by content rather than by array identity, so an inline items={[...]} does not wipe the strip on every render: what the user did in the meantime (closing a tab) survives until you actually hand over different data. Mirror onTabsChange back into your state to keep the two in step

Pro required

Reorderable Tabs (draggable)

Pro

Turn on draggable and a tab can be dragged along the strip — on the X axis when the tabs are horizontal, on the Y axis when they are vertical. The tab under the pointer at the moment you let go becomes the target position; release outside the strip and the order is left alone. Every landed reorder is reported through onTabsChange. Dragging is a pointer-only gesture, so this example also wires the same reordering to two buttons with the exported reorderTabItems helper — that is the keyboard path your users will need

Pro required

State Persistence

Pro

URL sync and localStorage persistence

Pro required
Previous
Table
Next
Alert Dialog
Pro
MoonUIMoonUI

168 React components. 45 free under MIT, 123 Pro.

Unsubscribe anytime.

Product

  • Components
  • Templates
  • Pricing

Resources

  • Documentation
  • GitHub
  • Support

Legal

  • Privacy
  • Terms
  • Refund Policy
Made by Moontra Software
  • X
  • LinkedIn
  • GitHub
  • YouTube