NOCTA UI

Tabs

Accessible tabs component with multiple variants, orientations, and keyboard navigation for organizing content

Installation

Install the Tabs component using the nocta-ui CLI:

npx nocta-ui add tabs

Import the component:

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

Examples

The Tabs component follows a composable architecture where you build tabbed interfaces by combining smaller components together.

Overview

View your account overview and recent activity.

This is the overview tab content. You can add any components here.

Variants

The Tabs component supports three visual variants: default, pills, and underline.

Default

Account settings and profile information.

Pills

Welcome to the home page content.

Underline

Your dashboard overview and quick stats.

Sizes

Three size options are available: sm, md, and lg. The default size is md.

Small

Small tab content.

Medium

Medium tab content.

Large

Large tab content.

Vertical Orientation

Tabs can be displayed vertically using the orientation="vertical" prop.

General Settings

Manage your general account settings and preferences.

This is your public display name.

Your email address for notifications.

Disabled States

Individual tabs can be disabled using the disabled prop on TabsTrigger.

This tab is available and can be accessed.

Api Reference

Tabs

PropTypeDefaultDescription
childrenReact.ReactNodeTabs content
valuestringControlled active tab value
defaultValuestringDefault active tab value
onValueChange(value: string) => voidCallback when tab changes
orientation'horizontal' | 'vertical''horizontal'Tabs orientation
variant'default' | 'pills' | 'underline''default'Visual variant
size'sm' | 'md' | 'lg''md'Size variant
classNamestring''Additional CSS classes
disabledbooleanfalseDisable all tabs

TabsList

PropTypeDefaultDescription
childrenReact.ReactNodeTab triggers
classNamestring''Additional CSS classes

TabsTrigger

PropTypeDefaultDescription
childrenReact.ReactNodeTrigger content
valuestringUnique tab identifier
classNamestring''Additional CSS classes
disabledbooleanfalseDisable this tab

TabsContent

PropTypeDefaultDescription
childrenReact.ReactNodeContent to display
valuestringTab identifier this content belongs to
classNamestring''Additional CSS classes

The Tabs components also accept all standard HTML attributes for their respective elements.