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 Stepper/InputStepper component to a v7 Stepper component.
id prop if not present. The id prop is required. Update prop value to an appropriate value.Stepper, adds readOnly={true}. If the input should be editable, set to false or remove this prop.labels.increaseButton to labelOverrides.increaseScreenReaderLabel.labels.decreaseButton to labelOverrides.decreaseScreenReaderLabel.onIncrease prop which is deprecated. Use the onChange prop to get the updated value.onDecrease prop which is deprecated. Use the onChange prop to get the updated value.theme prop to the className prop. If it cannot, deletes the theme prop.For example:
import { Stepper } from '@americanexpress/dls-react6';
export default function Page() {
return (
<Stepper
labels={{ increaseButton: 'Increase', decreaseButton: 'Decrease' }}
onIncrease={onIncrease}
onDecrease={onDecrease}
onChange={onChange}
theme={{ color: 'red' }}
{...otherProps}
/>
);
}
Transforms into:
import { Stepper } from '@americanexpress/dls-react';
export default function Page() {
return (
<Stepper
labelOverrides={{
increaseScreenReaderLabel: 'Increase',
decreaseScreenReaderLabel: 'Decrease',
}}
onChange={onChange}
readOnly={true}
id="unique-id-for-stepper"
{...otherProps}
/>
);
}
The onChange signature has been updated from (newValue: number) => void to (event: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLButtonElement>, newValue: number | null) => void. The onChange is now triggered from editing the input, clicking the increase button, or clicking the decrease button.
Connect with the DLS Team on Slack or by email.
Check out additional resources.