Skip to content

Navigation

Tabs

Bundle size
6.63 KB
3.0.0

A set of content sections - where only one can be displayed at a time.

This component is an expansion of the Tabs developed and maintained by Radix UI.

It adheres to the Tabs WAI-ARIA design pattern.

KeyDescription
Tab

When focus moves onto the tabs, focuses the active trigger. When a trigger is focused, moves focus to the active content.

Moves focus to the previous trigger depending on orientation and activates its associated content.

Moves focus to the next trigger depending on orientation and activates its associated content.

Moves focus to the previous trigger depending on orientation and activates its associated content.

Moves focus to the next trigger depending on orientation and activates its associated content.

Home

Moves focus to the first trigger and activates its associated content.

End

Moves focus to the last trigger and activates its associated content.

Terminal window
pnpm add @inpulse-ui/tabs

Contains all the tabs component parts.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
defaultValuestring-No
valuestring-No
onValueChangefunction-No
orientation

enum

No
side

enum

No
dir

enum

No
activationMode

enum

No

Contains the triggers that are aligned along the edge of the active content.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
align

enum

No
loopbooleantrueNo
monobooleanfalseNo

The button that activates its associated content.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
valuestring-Yes
disabledbooleanfalseNo

Contains the content associated with each trigger.

PropTypeDefault ValueRequired
asChildbooleanfalseNo
valuestring-Yes
forceMountboolean-No

An optional element that visually indicates the active tab. It is not mandatory but when applied within TabsList, it causes the selection indicator to move with a smooth animation.

It inherits props from the TabsList component.

PropTypeDefault ValueRequired
asChildbooleanfalseNo

Wrap all tabs component parts with the Tabs component. The TabsList contains the triggers. Make sure there is a TabsContent for each TabsTrigger and that the value prop of each TabsContent matches the value prop of its corresponding TabsTrigger.

<Tabs>
<TabsList>
<TabsTrigger value="password">Password</TabsTrigger>
</TabsList>
<TabsContent value="password">Change your password here.</TabsContent>
</Tabs>

By default, Tabs are displayed horizontally and inherit the theme’s primary color. TabsIndicator is not mandatory but when applied within TabsList, it causes the selection indicator to move with a smooth animation.

Otherwise, the selection indicator will still be applied - but without any animation.

In the next examples, TabsIndicator will always be applied as it offers a better experience.

Tabs can also be displayed vertically. To do this, simply add the orientation property to Tabs, with the value vertical.

Only in vertical mode, it is possible to change the side where the TabList is presented using the side property. Possible values are left and right.

By default, TabsTriggers are displayed at the beginning of the TabsList. To change the position, simply change the align property in the TabsList. Possible values are start, center and end.

By default, TabsTrigger and TabsIndicator will be assigned the theme’s primary color when enabled. But you can customize this color through CSS classes. The class must be applied to the two components mentioned, as below.

Adopt a monochromatic style for your Tabs by setting the mono property to true. This style will adapt to the system’s light and dark mode. The property must be applied once, directly in the TabsList.

Use the onChange event to perform an action every time the Tabs tab is changed.

By applying the asChild property to TabsTrigger, it is possible to use any component in place of text.

Project

Built with by Jo Santana in Brazil.

© 2026 Inpulse. All rights reserved.