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
A series of transforms which convert the following v6 button components into their appropriate v7 components:
Button with the appropriate variant prop:
ButtonPrimary -> Button with variant='primary'ButtonPrimaryDark -> Button with variant='primary'ButtonSecondary -> Button with variant='secondary'ButtonSecondaryDark -> Button with variant='secondary'ButtonTertiary -> Button with variant='tertiary'ButtonTertiaryDark -> Button with variant='tertiary'styleType prop on Button to variant, and adjusts the value as needed:
styleType='primary' -> variant='primary'styleType='secondary' -> variant='secondary'styleType='tertiary' -> variant='tertiary'styleType='white' -> variant='primary'styleType='whiteSecondary' -> variant='secondary'styleType='whiteTertiary' -> variant='tertiary'styleType='contextual' -> variant='primary'IconButton to Button and performs the same adjustments to the styleType prop described above for Button.disabled to aria-disabled.label to aria-label.loading prop to isLoading.theme prop, which has been deprecated. Use the className prop to apply custom styles.allowOverflow prop, which has been deprecated. All buttons now overflow by default.size prop, which has been deprecated.For example:
import {
Button,
IconButton,
ButtonSecondaryDark,
} from '@americanexpress/dls-react6';
export default function Page() {
return (
<>
<Button styleType="white" disabled={isDisabled} {...otherProps}>
Some Button
</Button>
<IconButton
styleType="contextual"
icon={<IconAccessibility />}
loading={true}
{...otherProps}
>
Some Button
</IconButton>
<ButtonSecondaryDark
size="sm"
allowOverflow={true}
disabled={isDisabled}
{...otherProps}
>
Some Button
</ButtonSecondaryDark>
</>
);
}
Transforms into:
import { Button } from '@americanexpress/dls-react';
export default function Page() {
return (
<>
<Button variant="primary" aria-disabled={isDisabled} {...otherProps}>
Some Button
</Button>
<Button
variant="primary"
icon={<IconAccessibility />}
isLoading={true}
{...otherProps}
>
Some Button
</Button>
<Button variant="secondary" aria-disabled={isDisabled} {...otherProps}>
Some Button
</Button>
</>
);
}
Certain button variants have been removed from the DLS and do not have an equivalent replacement in v7. To get the equivalent functionality in v7, first reconsider the use of the component in your application. If the component is still needed, consider customizing the default Button component using the className prop to get the desired functionality.
Button variants removed without an equivalent in v7 include:
Button and IconButton with styleType:
'chevron''floatingChat''floatingScroll''' (resulted in a ButtonBase component)ButtonBaseButtonChevronButtonCobrandButtonFloatingChatButtonFloatingScrollsizeThe size prop has been removed. In most cases, there is no further action. If your application was previously relying on a button being a specific size, first reconsider the other parts of your application. If a specific size is still needed, the size of the button can be customized using the className prop and adjusting the width and/or height attributes.
Connect with the DLS Team on Slack or by email.
Check out additional resources.