@workday/canvas-kit-labs-react-tabs v4.8.1
Canvas Kit React Tabs
Composable tab components
Installation
yarn add @workday/canvas-kit-labs-react-tabsUsage
import * as React from 'react';
import {Tabs} from '@workday/canvas-kit-labs-react-tabs';
export default () => (
<Tabs>
<Tabs.List>
<Tabs.Item>First Tab</Tabs.Item>
<Tabs.Item>Second Tab</Tabs.Item>
</Tabs.List>
<div css={{marginTop: spacing.m}}>
<Tabs.Panel>Contents of First Tab</Tabs.Panel>
<Tabs.Panel>Contents of Second Tab</Tabs.Panel>
</div>
</Tabs>
);Table of Contents
Tabs
Static Properties
None
Component Props
Required
children: React.ReactElement<TabListProps> | React.ReactElement<TabPanelsProps>
Tabs cannot be empty
Optional
initialTab: string
The
nameof the tab that should be active first. If not provided, the first tab will be active.
onTabChange: (name: string) => void
Callback when a tab changes. The
namewill be thenameprop passed into theTabs.ItemandTabs.Panelcomponent. If anameisn't provided, the value will be a string of the index of the tab.
Tabs.List
Static Properties
None
Component Props
Required
children: React.ReactElement<TabProps> | React.ReactElement<TabProps>[]
TabList cannot be empty
Optional
None
Tabs.Item
Static Properties
None
Component Props
Required
children: React.ReactNode
The label text of the Tab
Optional
name: string
The name of the tab. This name will be used in change events and for
initialTab. Must match thenameof the associated tab panel. If this property is not provided, it will default to a string representation of the the zero-based index of the Tab when it was initialized.
Tabs.Panel
Static Properties
None
Component Props
Required
children: React.ReactNode
The contents of the TabPanel
Optional
name: string
The name of the tab. This name will be used in change events and for
initialTab. Must match thenameof the associated tab panel. If this property is not provided, it will default to a string representation of the the zero-based index of the Tab when it was initialized.
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago