Fidely UI v1 beta is now available!. 🚀

Tabs

A component used to display multiple views or sections of related content using tabbed navigation.

React is a free and open-source front-end JavaScript library

Usage

import { Tabs } from '@fidely-ui/react'
<Tabs.Root>
  <Tabs.List>
    <Tabs.Trigger />
    <Tabs.Indicator />
  </Tabs.List>
  <Tabs.Content />
</Tabs.Root>

Examples

Variants

Use the variant prop to change the visual style of the tabs.

Manage your team members
Manage your team members

Sizes

Use the size prop to adjust the spacing and font size of the tabs.

Manage your team members
Manage your team members
Manage your team members

Disabled

Set the disabled prop on the Tabs.Trigger component to disable a tab

Manage your team members

Manual Activation

By default, tabs are automatically selected when navigated with arrow keys.

Set activationBehavior prop to manual on Tabs.Root to disable this behavior — tabs will only activate when clicked or when pressing Enter.

Store (State Managed)

An alternative way to control the Tabs is to use the RootProvider component and the useTabs store hook.

This way you can access the tabs state and methods from outside the tabs.

Manage your team members

selected: teams

Controlled Tabs

Use the value and onValueChange prop to control the active tab.

First panel

Pass the asChild to the Tabs.Trigger component to render a link as a tab. When a tab is clicked, the link will be navigated to.

Props

Root

PropTypeDefaultDescription
defaultValuestring—The tab value to activate by default.
activationMode"automatic" \ "manual"automaticThe activation mode of the tabs. Can be manual or automatic - manual: Tabs are activated when clicked or press enter key. - automatic: Tabs are activated when receiving focus
valuestring—The controlled value of the active tab..
onValueChange(value: string) => void—Callback fired when a tab value changes..
lazyMountbooleanfalseWhether to enable lazy mounting.
loopFocusbooleanfalseWhether the keyboard navigation will loop from last tab to first, and vice versa.

Tabs.List

PropTypeDefaultDescription
asChildbooleanfalsePasses props to a custom child element.

Tabs.Trigger

PropTypeDefaultDescription
valuestring—The value associated with this tab trigger.
disabledbooleanfalseDisables interaction with the tab.
asChildbooleanfalseRenders a custom element instead of the default button.

Tabs.Content

PropTypeDefaultDescription
valuestring-The value associated with this content panel.
asChildbooleanfalseRenders a custom element instead of the default container.

On this page