Codemods

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.

Back to All Codemods

ButtonBase Transform

Converts a v6 ButtonBase component to a v7 ButtonBase component.

Automatic Changes

  • Renames the disabled prop to aria-disabled.
  • Removes the size prop, which has been deprecated. If a specific button size is needed, apply custom styling.
  • Removes the allowOverflow prop, which has been deprecated. All v7 Buttons allow text overflow by default, as showing ellipsis for text overflow is not accessible.
  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.

For example:

import { ButtonBase } from '@americanexpress/dls-react6';

export default function Page() {

return (

<ButtonBase

disabled={disabled}

size="sm"

allowOverflow={true}

theme={{ color: 'red' }}

{...otherProps}

>

Button Text

</ButtonBase>

);

}

Transforms into:

import { ButtonBase } from '@americanexpress/dls-react';

export default function Page() {

return (

<ButtonBase aria-disabled={disabled} {...otherProps}>

Button Text

</ButtonBase>

);

}

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.