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 Carousel component to a v7 Carousel component.
navigationPagination prop to navigationStyle. If navigationPagination is true, then navigationStyle="text". Otherwise navigationStyle="dots".type prop to isSlideFullWidth. If type is "small", then isSlideFullWidth={false}. Otherwise isSlideFullWidth={true}.heading prop to labelOverrides['aria-label'].animate prop, which has been deprecated.headingLevel prop, which has been deprecated.autoplay prop to shouldAutoPlay.onChange prop to onSlideChange.nextButtonLabel prop to labelOverrides.nextButtonScreenReaderLabel.previousButtonLabel prop to labelOverrides.previousButtonScreenReaderLabel.playLabel prop to labelOverrides.playButtonScreenReaderLabel.pauseLabel prop to labelOverrides.pauseButtonScreenReaderLabel.getSlideButtonLabel prop to labelOverrides.getDotNavigationScreenReaderLabel.getPaginationText prop to labelOverrides.getTextNavigationLabel.theme prop to the className prop. If it cannot, deletes the theme prop.For example:
import { Carousel } from '@americanexpress/dls-react6';
export default function Page() {
return (
<Carousel
navigationPagination={true}
type="small"
animate={animate}
heading="Carousel"
headingLevel={headingLevel}
autoplay={autoplay}
onChange={onChange}
nextButtonLabel="Go to next offer"
previousButtonLabel="Go to previous offer"
playLabel="Play carousel"
pauseLabel="Pause carousel"
getSlideButtonLabel={(slideNumber) => `Offer ${slideNumber}`}
getPaginationText={(current, total) => `Offer ${current} of ${total}`}
theme={{ color: 'red' }}
{...otherProps}
>
{/** Children */}
</Carousel>
);
}
Transforms into:
import { Carousel } from '@americanexpress/dls-react';
export default function Page() {
return (
<Carousel
navigationStyle="text"
isSlideFullWidth={false}
shouldAutoPlay={autoplay}
onSlideChange={onChange}
{...otherProps}
labelOverrides={{
'aria-label': 'Carousel',
nextButtonScreenReaderLabel: 'Go to next offer',
previousButtonScreenReaderLabel: 'Go to previous offer',
playButtonScreenReaderLabel: 'Play carousel',
pauseButtonScreenReaderLabel: 'Pause carousel',
getDotNavigationScreenReaderLabel: (slideNumber) =>
`Offer ${slideNumber}`,
getTextNavigationLabel: (current, total) =>
`Offer ${current} of ${total}`,
}}
>
{/** Children */}
</Carousel>
);
}
Connect with the DLS Team on Slack or by email.
Check out additional resources.