The American Express Design System provides a unified language for designing American Express websites and experiences. The design system provides design resources that match our coded components and are aligned with the American Express brand. Included are colors, components, icons and glyphs, type styles, and graphic assets to get you up and running quickly.
On this page
Converts a v6 TabGroup component to a v7 Tabs component.
theme prop to the className prop. If it cannot, deletes the theme prop.TabGroup to Tabs.defaultSelectedTab prop to defaultSelectedTabId.selectedTab prop to selectedTabId.onChange prop to onSelectedTabIdChange.<TabContentGroup> component and moves its children to the <Tabs> component.For example:
import { TabGroup } from '@americanexpress/dls-react6';
export default function Page() {
return (
<TabGroup
defaultSelectedTab="tab-1"
selectedTab="tab-2"
onChange={() => {}}
theme={{ color: 'red' }}
{...otherProps}
>
<TabMenu>
<Tab id="tab-1" contentId="tab-panel-1">
Tab 1
</Tab>
</TabMenu>
<TabContentGroup>
<TabContent id="tab-panel-1" labelledBy="tab-1">
Tab 1 content
</TabContent>
</TabContentGroup>
</TabGroup>
);
}
Transforms into:
import { Tabs } from '@americanexpress/dls-react';
export default function Page() {
return (
<Tabs
defaultSelectedTabId="tab-1"
selectedTabId="tab-2"
onSelectedTabIdChange={() => {}}
{...otherProps}
>
<TabList>
<Tab id="tab-1">Tab 1</Tab>
</TabList>
<TabPanel aria-labelledby="tab-1">Tab 1 content</TabPanel>
</Tabs>
);
}
Note: The code example shows other Tab components being transformed as well for the sake of accuracy. Please refer to the Tab, TabMenu, TabContent transforms for more information.
Connect with the DLS Team on Slack or by email.
Check out additional resources.