Tabs
A tabs component lets you tab between content.
Import#
Tabs: The component that provides the context to the other components.Tabs.Menu: Wrapper forTabs.Tab. Keeps track of the currently selected tab.Tabs.Tab: The individual tab button used to navigate between tabs.Tabs.Panels: Wrapper forTabs.Panel. Keeps track of the currently selected panel.Tabs.Panel: The individual panel. This is where your content goes.
Usage#
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^Props#
colorScheme#
Use the colorScheme prop to change the colors of the tabs. You can use one of the built-in schemes, or pass a list of class names to create your own.
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^direction#
You can choose the direction of the tabs by using the direction prop. It can be either horizontal or vertical. It defaults to horizontal.
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^variant#
You can choose the style of the tabs by using the variant prop. It can be either underline or pills. It defaults to underline.
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^isFitted#
You can make the tabs take up the full width by passing the isFitted prop. This only works when the direction is set to horizontal (that's the default).
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^isLazy#
If you don't want to render the children of the panels unless it's active you can use the isLazy prop.
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^Controlled mode#
The tabs component is stateful by default, but can easily be turned in to a controlled component by passing the index and onChange props.
SyntaxError: Unexpected token (1:8)
1 : return ()
            ^Accessability#
Tabs follows the practices for tabs found at WAI-ARIA Authoring Practices.
- Only the active tab is allowed focus.
 - Tabbing from the tab gives focus to the current tab panel.
 - Using the arrow keys navigates the between tabs.
 HomeandEndnavigates to the start and end of the tabs.Tabs.Panelhas the role oftabpanel.Tabs.Menuhas the role oftablist.Tabs.Tabhas the role oftab.Tabs.Panelhasaria-hiddenwhen not selected.Tabs.Panelhasaria-labelledbyset to the id of theTabs.Tabwith the same index.