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 MultiSelect component to a v7 MultiSelect component.
theme prop to the className prop. If it cannot, deletes the theme prop.disabled prop to aria-disabled.ariaLabel prop to aria-label.onChange prop to onSelectedValuesChange.fluid prop.getSelectedCount prop. Previously, the number of selected items would be announced via the screen reader after ever selection. In v7, we’ve removed this and instead announce the total selected options once the user is finished selecting and closes the Popover. When the focus is back on the MultiSelect, the total selected options will be announced.showSelectedCount prop. Previously, this was used in conjunction with getSelectedCount. Since we’ve removed getSelectedCount, this prop is no longer needed.success with default for the status prop, since MultiSelect does not support the success status.For example:
import { MultiSelect } from '@americanexpress/dls-react6';
export default function Page() {
return (
<MultiSelect
disabled={isDisabled}
ariaLabel="label"
onChange={(selectedId, isSelected) => {}}
onOptionsToggle={(isHidden) => {}}
fluid={true}
getSelectedCount={getSelectedCount}
showSelectedCount={true}
status="success"
theme={{ color: 'red' }}
{...otherProps}
>
{/** Children */}
</MultiSelect>
);
}
Transforms into:
import { MultiSelect } from '@americanexpress/dls-react';
export default function Page() {
return (
<MultiSelect
aria-disabled={isDisabled}
aria-label="label"
onChange={(selectedValue, isSelected) => {}}
onIsOpenChange={(isOpen) => {}}
{...otherProps}
>
{/** Children */}
</MultiSelect>
);
}
fluid has been deprecatedMultiSelect is now fluid by default. To prevent the component from occupying the full width of the container it is in, we recommend applying a utility class (like col-md-6) to the component or limiting the width of the container it is in.
onOptionsToggle has been renamed to onIsOpenChange with a different signatureWe’ve renamed the onOptionsToggle prop to onIsOpenChange and inverted the boolean argument in the function signature (i.e onOptionsToggle={isHidden => {}} is converted to onIsOpenChange={isOpen => {}}).
onSelectedValuesChange has a different signature than onChangePreviously, the first parameter, selectedId, of the onChange function was the id of the selected value, and the second parameter, isSelected, was a boolean indicating if the selectedId was selected or deselected. In v7, the first parameter, selectedValue, of the onSelectedValuesChange function is the value instead of the id. This value is the same as the value prop of the <MultiSelectOption> component. The second parameter is unchanged and is a boolean indicating if the selectedValue was selected or deselected.
Connect with the DLS Team on Slack or by email.
Check out additional resources.