Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
Tabs are used to organize content by grouping similar information on the same page.
import { Tabs, Item, Header, Content, TabsContext, useTabsContext } from "@sharegate/orbit-ui";
aria-label
property.We recommend specifying a unique key
prop for every <Item>
. If you choose to omit the key
prop, a key matching the <Item>
position will be generated. For example, "0"
would be the generated key for the first <Item>
of a <Tabs>
component without keys.
A default tabs.
A tab can contain icons.
A tab can contains a lozenge.
Tabs items can be rendered dynamically.
By default, tabs are activated automatically. This means when you use the arrow keys to change tabs, the tab is activated and focused.
The content of a tab should ideally be preloaded. However, if switching to a tab panel causes a network request and possibly a page refresh, there might be some notable latency and this might affect the experience for keyboard and screen reader users.
In this scenario, you should use a manually activated tab, it moves focus without activating the tabs. With focus on a specifc tab, users can activate a tab by pressing Space
or Enter
.
A tab can use useTabsContext
to load async content when a tab is selected.
A tabs component can be rendered vertically.
A tabs component can split the width of it's container equally between his tabs.
A tabs component can handle horizontal overflow by collapsing the overflowing tabs in a popup.
A tab can be disabled.
The selectedKey
state can be handled in controlled mode.
import { Tabs } from "@sharegate/orbit-ui";
Name | Description | Default | ||||
---|---|---|---|---|---|---|
aria-label* | See WCAG. string | - | ||||
autoFocus | Whether or not the first focusable tab should autoFocus on render. numberfalsetrue | - | ||||
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - | ||||
collapsible | Whether or not the tabs could collapsed to fit into the available space. falsetrue | true | ||||
defaultSelectedKey | The initial value of selectedKey when uncontrolled.string | - | ||||
fluid | Whether or not the tabs take up the width of the container. false | true | ResponsiveValue<boolean> | - | ||||
manual | Whether or not keyboard navigation changes focus between tabs but doens't activate it. falsetrue | - | ||||
onSelectionChange | Called when the selected tab change. (event: SyntheticEvent<Element, Event>, key: string) => void
| - | ||||
orientation | The orientation of the tabs elements. "horizontal" | "vertical" | ResponsiveValue<TabsOrientation> | horizontal | ||||
selectedKey | A controlled selected key. string | - |
import { Item } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
key | A unique key to identify the item. string | - |
import { Header } from "@sharegate/orbit-ui";
"icon", "text", "lozenge"
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
slot | Slot to render into. string | - |
import { Content } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
slot | Slot to render into. string | - |
import { Tab } from "@sharegate/orbit-ui";
"icon", "text", "lozenge"
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
onSelect* | Called when the tab is selected. (event: SyntheticEvent<Element, Event>, key: string) => void | - |
selected | Whether or not the tab is selected. falsetrue | - |
tab* | Matching tab item. TabType | - |
import { TabPanel } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
panel* | Matching panel item. PanelType | - |