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.

On this page

Back to All Codemods

Icons Transform

Converts a v6 Icon component to a v7 Icon component.

Automatic Changes

  • Renames the filled prop to isFilled.
  • Updates the value of the size prop if possible:
    • "sm" => "xs"
    • "md" => "sm"
    • "lg" => "md"
    • "xl" => "lg"
  • Attempts to transform the deprecated theme prop to the color prop. If it cannot, deletes the theme prop.
  • Updates component name for the following Icon components:
    • IconAutopay -> IconDollarAutopay
    • IconCaptionsOff -> IconClosedCaptionsOff
    • IconCaptionsOn -> IconClosedCaptions
    • IconCashback -> IconDollarCashback
    • IconDown -> IconArrowDown
    • IconFavorite -> IconStar
    • IconFilterDown -> IconSortDown
    • IconFilterUp -> IconSortUp
    • IconLeft -> IconArrowLeft
    • IconMore -> IconMoreCircle
    • IconRight -> IconArrowRight
    • IconSoundOn -> IconSound
    • IconUp -> IconArrowUp
    • IconWatch -> IconSmartwatch
    • IconWiFi -> IconWifi
    • IconTrends -> IconBarChart
  • Updates import source to @americanexpress/dls-icons. Icon components are no longer available in @americanexpress/dls-react as of v7.0.0.

For example:

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

import { IconWarning } from '@americanexpress/dls-icons6';

export default function Page() {

return (

<>

<IconAccessibility

title="Accessibility"

titleId="accessibility-icon-id"

filled={true}

size="sm"

theme={dlsBrightBlue}

/>

<IconWarning

title="Warning"

titleId="warning-icon-id"

filled={true}

size="md"

theme={dlsColorWarning}

/>

</>

);

}

Transforms into:

import { IconAccessibility, IconWarning } from '@americanexpress/dls-icons';

export default function Page() {

return (

<>

<IconAccessibility

title="Accessibility"

titleId="accessibility-icon-id"

isFilled={true}

size="xs"

color="brand"

/>

<IconWarning

title="Warning"

titleId="warning-icon-id"

isFilled={true}

size="sm"

color="error"

/>

</>

);

}

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.