Components

Tabs

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

Loading

Installation

pnpm dlx shadcn@latest add @toui/tabs

Examples

Icon

Loading

Badge

Loading

Button

Loading

Pill

Loading

Line

Loading

Vertical

Loading

Size - Large

Loading

Size - Medium

Loading

Size - Small

Loading

Size - Xsmall

Loading

Disabled

Loading

Pattern

Tokens

25 CSS variables in 7 categories.

px

CSS VariableValueDescription
--tabs-px-xs0.5rem8px
--tabs-px-sm0.625rem10px
--tabs-px-md0.75rem12px
--tabs-px-lg1rem16px

py

CSS VariableValueDescription
--tabs-py-xs0.375rem6px
--tabs-py-sm0.5rem8px
--tabs-py-md0.625rem10px
--tabs-py-lg0.625rem10px

gap

CSS VariableValueDescription
--tabs-gap-xsvar(--component-gap-xs)
--tabs-gap-smvar(--component-gap-sm)
--tabs-gap-mdvar(--component-gap-sm)
--tabs-gap-lgvar(--component-gap-md)

text

CSS VariableValueDescription
--tabs-text-xsvar(--component-text-xs)
--tabs-text-smvar(--component-text-xs)
--tabs-text-mdvar(--component-text-sm)
--tabs-text-lgvar(--component-text-sm)

icon-size

CSS VariableValueDescription
--tabs-icon-size-xs0.875rem14px
--tabs-icon-size-sm0.875rem14px
--tabs-icon-size-md1rem16px
--tabs-icon-size-lg1.25rem20px

list-p

CSS VariableValueDescription
--tabs-list-p-xs0.25rem4px — container padding
--tabs-list-p-sm0.25rem
--tabs-list-p-md0.25rem
--tabs-list-p-lg0.375rem

radius

CSS VariableValueDescription
--tabs-radiusvar(--component-radius-md)

API Reference

This component is built using Radix UI Tabs primitives. For detailed information, please visit the full API reference.

Tabs

This component is based on the Tabs.Root primitive. For full details, visit the official documentation.

TabsList

This component is based on the Tabs.List primitive and includes the following custom props:

PropTypeDefault
variant enum "default"
size enum "md"
className stringundefined

TabsTrigger

This component is based on the Tabs.Trigger primitive and inherits the following props from context:

PropTypeDefault
variant enum "default"
size enum "md"
className stringundefined

TabsContent

This component is based on the Tabs.Content primitive and includes the following custom props:

PropTypeDefault
variant enum "default"
className stringundefined

Credits

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking Accept, you agree to our use of cookies.
Learn more.