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

Select Transform

Converts the v6 Select component to the v7 SelectNative component.

Automatic Changes

  • Renames the import and usages of Select to SelectNative.
  • Renames the locale prop to the native HTML lang prop.
  • Renames the disabled prop to aria-disabled.
  • Renames the twoLined prop to isTwoLined.
  • Attempts to transform the deprecated theme prop to the className prop. If it cannot, deletes the theme prop.
  • Deletes the fluid prop, which has been deprecated.

For example:

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

export default function Page() {

return (

<>

<Label htmlFor="select-1">Select 1</Label>

<Select

id="select-1"

locale="en-US"

disabled={isDisabled}

twoLined={isTwoLined}

fluid={isFluid}

{...otherProps}

>

{/** Children */}

</Select>

</>

);

}

Transforms into:

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

export default function Page() {

return (

<>

<Label htmlFor="select-1">Select 1</Label>

<SelectNative

id="select-1"

lang="en-US"

aria-disabled={isDisabled}

isTwoLined={isTwoLined}

{...otherProps}

>

{/** Children */}

</SelectNative>

</>

);

}

Manual Changes

Label

There are new props for handling the label associated with a Select. Move the text contents of the associated Label component to the label prop of the NativeSelect component.

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.