nqui
Components

Tabs

A tabbed interface component for organizing content

Tabs

The Tabs component provides a tabbed interface for organizing and switching between different views. Built on Radix UI primitives.

Import

import { Tabs, TabsList, TabsTrigger, TabsContent } from '@nqlib/nqui';

Basic Usage

import { Tabs, TabsList, TabsTrigger, TabsContent } from '@nqlib/nqui';

export default function Example() {
  return (
    <Tabs defaultValue="account">
      <TabsList>
        <TabsTrigger value="account">Account</TabsTrigger>
        <TabsTrigger value="password">Password</TabsTrigger>
      </TabsList>
      <TabsContent value="account">Account content</TabsContent>
      <TabsContent value="password">Password content</TabsContent>
    </Tabs>
  );
}

Examples

Basic Tabs

Make changes to your account here.

Line Variant

Account content

Variants

  • default - Default tab style with background
  • line - Line variant with underline indicator

Props

Tabs

PropTypeDefaultDescription
valuestring-Controlled active tab value
defaultValuestring-Uncontrolled default active tab
onValueChange(value: string) => void-Callback when tab changes
orientation"horizontal" | "vertical""horizontal"Tab layout direction
classNamestring-Additional CSS classes
All standard div props--Accepts HTML div attributes

TabsList

PropTypeDefaultDescription
orientation"horizontal" | "vertical"from TabsOverride list orientation
classNamestring-Additional CSS classes
All standard div props--Accepts HTML div attributes

TabsTrigger

PropTypeDefaultDescription
valuestring-Tab value (must match TabsContent)
disabledbooleanfalseWhether the trigger is disabled
classNamestring-Additional CSS classes
All standard button props--Accepts HTML button attributes

TabsContent

PropTypeDefaultDescription
valuestring-Tab value (must match TabsTrigger)
forceMountboolean-Force mount when inactive
classNamestring-Additional CSS classes
All standard div props--Accepts HTML div attributes

Accessibility

  • Full keyboard navigation
  • ARIA attributes
  • Focus management

Next Steps