Home
DocsPricingAbout
Sign InGet Started

Tabs

Tabs organize content into multiple sections and allow users to navigate between them.

Built on React Aria Components for full accessibility. Supports multiple variants, colors, sizes, and seamless Next.js router integration.

Installation

import { Tabs } from '@neo/test-components'

Usage

HeroUI Tabs use a compound component pattern. Each Tab contains its own Indicator for the sliding animation effect.

Account
Password
Settings

Account Settings

Manage your account information and preferences here.


Dynamic

You can render tabs dynamically from an array of items.

Photos
Music
Videos

Your photo collection


Disabled

Use isDisabled on the Tabs component to disable all tabs, or on individual Tab items.

Individual tab disabled:

Active
Disabled
Available

This tab is active and can be selected.

All tabs disabled:

Tab 1
Tab 2
Tab 3

Sizes

Three size options: sm,md (default), and lg.

Size: sm

Small
Tabs
Here

Size: md (default)

Medium
Tabs
Here

Size: lg

Large
Tabs
Here

Radius

Customize the border radius: none,sm,md,lg, or full.

Radius: none

Tab 1
Tab 2
Tab 3

Radius: sm

Tab 1
Tab 2
Tab 3

Radius: md

Tab 1
Tab 2
Tab 3

Radius: lg

Tab 1
Tab 2
Tab 3

Radius: full

Tab 1
Tab 2
Tab 3

Colors

Six color options that style the indicator and selected tab text.

default

Photos
Music
Videos

primary

Photos
Music
Videos

secondary

Photos
Music
Videos

success

Photos
Music
Videos

warning

Photos
Music
Videos

danger

Photos
Music
Videos

Variants

Four visual variants: solid (default),bordered,light, andunderlined.

solid

Photos
Music
Videos

bordered

Photos
Music
Videos

light

Photos
Music
Videos

underlined

Photos
Music
Videos

Underlined with Colors

The underlined variant works great with color options for navigation-style tabs.

default

Overview
Analytics
Reports

primary

Overview
Analytics
Reports

success

Overview
Analytics
Reports

warning

Overview
Analytics
Reports

danger

Overview
Analytics
Reports

With Icons

Add icons alongside tab labels for better visual context.

Photos
Music
Videos

Your photo gallery


Controlled

Use selectedKey andonSelectionChange for controlled tab selection.

Selected:photos
Photos
Music
Videos

Photos panel content


Vertical

Set orientation="vertical" for sidebar-style navigation.

Vertical Solid:

Profile
Security
Notifications
Billing

Profile Settings

Update your profile information and avatar.

Vertical Underlined:

Overview
Analytics
Reports
Settings

Overview content


Full Width

Use fullWidth to make tabs expand to fill the container.

First
Second
Third

First panel


Links (Next.js Router)

Tabs can be rendered as links with the href prop. Sync with Next.js router using selectedKey.

Current pathname: /components/tabs

Dashboard
SettingsProfile

Note: Navigation is simulated. In production, tabs would sync with URL via Next.js router.

'use client'

import { useRouter, usePathname } from 'next/navigation'
import { Tabs } from '@neo/test-components'

export function NavigationTabs() {
  const router = useRouter()
  const pathname = usePathname()

  return (
    <Tabs 
      variant="underlined"
      selectedKey={pathname}
      onSelectionChange={(key) => router.push(key as string)}
    >
      <Tabs.ListContainer>
        <Tabs.List aria-label="Navigation">
          <Tabs.Tab id="/dashboard" href="/dashboard">
            Dashboard
            <Tabs.Indicator />
          </Tabs.Tab>
          <Tabs.Tab id="/settings" href="/settings">
            Settings
            <Tabs.Indicator />
          </Tabs.Tab>
        </Tabs.List>
      </Tabs.ListContainer>
    </Tabs>
  )
}

Custom Styles

Customize tabs with Tailwind CSS classes via the className andclassNames props.

Photos
Music
Videos

Custom photos panel


Disable Animation

Use disableAnimation ordisableCursorAnimation to turn off the indicator animation.

Tab 1
Tab 2
Tab 3

Slots

Customize specific parts of the Tabs component using CSS classes targeting these slots:

  • .tabs - Root container
  • .tabs__list-container - Tab list wrapper
  • .tabs__list - Tab list (contains tabs)
  • .tabs__tab - Individual tab button
  • .tabs__indicator - Animated selection indicator
  • .tabs__panel - Tab panel content

Data Attributes

Tab elements expose these data attributes for styling:

  • [data-selected] - When tab is selected
  • [data-disabled] - When tab is disabled
  • [data-hovered] - When tab is hovered
  • [data-focus-visible] - When tab has keyboard focus
  • [data-pressed] - When tab is being pressed
  • [data-orientation] - "horizontal" or "vertical"

Accessibility

  • ✓ Mouse, touch, and keyboard interactions supported
  • ✓ Arrow key navigation between tabs
  • ✓ Disabled tabs properly announced
  • ✓ Follows ARIA tabs pattern with proper roles
  • ✓ Tab panels associated with their triggers
  • ✓ Focus management for panels without focusable children

API Reference

Tabs Props

PropTypeDefaultDescription
children*ReactNode-Tab content
variant"solid" | "bordered" | "light" | "underlined""solid"Visual style variant
color"default" | "primary" | "secondary" | "success" | "warning" | "danger""default"Color theme
size"sm" | "md" | "lg""md"Tab size
radius"none" | "sm" | "md" | "lg" | "full"variesBorder radius style
orientation"horizontal" | "vertical""horizontal"Tab layout direction
fullWidthbooleanfalseTabs expand to fill container
selectedKeyKey-Controlled selected tab
defaultSelectedKeyKey-Default selected tab
isDisabledbooleanfalseDisable all tabs
disableAnimationbooleanfalseDisable indicator animation
showSeparatorsbooleantrueShow dividers (solid variant)

Tabs Events

EventTypeDescription
onSelectionChange(key: Key) => voidCalled when selected tab changes

Tabs.Tab Props

PropTypeDefaultDescription
id*string-Unique tab identifier
childrenReactNode-Tab content (label + indicator)
isDisabledbooleanfalseDisable this tab
hrefstring-URL for tab as link

Tabs.Panel Props

PropTypeDefaultDescription
id*string-Matching tab id
childrenReactNode-Panel content
NEOTestground
AboutTermsPrivacyContact

© 2025 NEO Platform


Render Performance Report

— Tabs
Componenthybrid

React Server Component • Pre-rendered with ISR • HeroUI v3 components