Pallas UI
DocsComponents
Core Concepts
    • Introduction
    • Getting Started
    • Theming
    • Color Tokens
    • Spacing & Sizing
    • Layout Guide
    • AspectRatio
    • Box
    • Flex
    • Grid
    • Shapes
Previews
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Breadcrumb
    • Button
    • Carousel
    • Checkbox
    • Combobox
    • Command
    • Date Picker
    • Form
    • Input
    • Input OTP
    • Label
    • MenuBar
    • Modal
    • Popover
    • Progress
    • Radio Group
    • ScrollArea
    • Segmented
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Spinner
    • Steps
    • Switch
    • Tabs
    • Textarea
    • Toast
    • Tooltip
    • TreeView
    • Typography
  1. Components
  2. Tabs

Tabs

A set of layered sections of content—known as tab panels—that are displayed one at a time.

Loading preview...

Installation

Install the following dependencies

npm install @radix-ui/react-tabs

Copy and paste the following code into your project

'use client'
 
import { createStyleContext } from '@pallas-ui/style-context'
import type { Assign, WithFixedClassName } from '@pallas-ui/style-context'
import * as RadixTabs from '@radix-ui/react-tabs'
import { type TabsVariantProps, tabs } from '@styled-system/recipes'
import type { ComponentProps, JsxStyleProps } from '@styled-system/types'
import type * as React from 'react'
 
const { withProvider, withContext } = createStyleContext(tabs)
 
export type RootProps = WithFixedClassName<ComponentProps<typeof RadixTabs.Root>>
export const Root = withProvider<
  React.ComponentRef<typeof RadixTabs.Root>,
  Assign<RootProps, TabsVariantProps>
>(RadixTabs.Root, 'root')
 
export const TabList = withContext<
  React.ComponentRef<typeof RadixTabs.List>,
  Assign<WithFixedClassName<ComponentProps<typeof RadixTabs.List>>, JsxStyleProps>
>(RadixTabs.List, 'tabList')
 
export const Trigger = withContext<
  React.ComponentRef<typeof RadixTabs.Trigger>,
  Assign<WithFixedClassName<ComponentProps<typeof RadixTabs.Trigger>>, JsxStyleProps>
>(RadixTabs.Trigger, 'trigger')
 
export const Content = withContext<
  React.ComponentRef<typeof RadixTabs.Content>,
  Assign<WithFixedClassName<ComponentProps<typeof RadixTabs.Content>>, JsxStyleProps>
>(RadixTabs.Content, 'content')
 
const Tabs = {
  Root,
  TabList,
  Trigger,
  Content,
}
 
export default Tabs

Update the import paths to match your project setup

Usage

import Tabs from '@/components/ui/tabs'
<Tabs.Root defaultValue="account">
  <Tabs.TabList>
    <Tabs.Trigger value="account">Account</Tabs.Trigger>
    <Tabs.Trigger value="password">Password</Tabs.Trigger>
  </Tabs.TabList>
  <Tabs.Content value="account">Account content</Tabs.Content>
  <Tabs.Content value="password">Password content</Tabs.Content>
</Tabs.Root>

Examples

Default

Loading preview...

Card

Loading preview...

Sizes

Loading preview...

Alignment

Loading preview...

Positions

Loading preview...

Custom Styles

Loading preview...

Built with ❤️ by the carbonteq team. The source code is available on GitHub.

© 2026 Pallas UI. All rights reserved.

Account

Make changes to your account here. Click save when you're done.

Account

Make changes to your account here. Click save when you're done.

Overview content goes here.
Small tab content
Medium tab content
Large tab content
Start aligned content
Center aligned content
End aligned content
Content for Tab 1
Content for Tab 1
Content for Tab 1
Content for Tab 1
Content 1