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 ToggleSwitch component to a v7 ToggleSwitch component.
disabled prop to aria-disabled prop.srLabelToggleOn which has been deprecated. Use the onText and hideToggleStatus props to customize the on text and whether it is shown.srLabelToggleOff which has been deprecated. Use the offText and hideToggleStatus props to customize the off text and whether it is shown.theme prop to the className prop. If it cannot, deletes the theme prop.For example:
import { ToggleSwitch } from '@americanexpress/dls-react6';
export default function Page() {
return (
<ToggleSwitch
aria-labelledby="toggle-label"
disabled={isDisabled}
srLabelToggleOn="On"
srLabelToggleOff="Off"
theme={{ color: 'red' }}
{...otherProps}
/>
);
}
Transforms into:
import { ToggleSwitch } from '@americanexpress/dls-react';
export default function Page() {
return (
<ToggleSwitch
aria-labelledby="toggle-label"
aria-disabled={isDisabled}
{...otherProps}
/>
);
}
A visual label is required. Use the label prop or provide a custom label using the aria-labelledby prop.
Connect with the DLS Team on Slack or by email.
Check out additional resources.