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 Pagination component to a v7 Pagination component.
id prop if not present. The id prop is now required. Update prop value to an appropriate value.selected prop to selectedPage.skipFirstText prop to labelOverrides.skipToFirstScreenReaderLabel.previousText prop to labelOverrides.previousScreenReaderLabel.nextText prop to labelOverrides.nextScreenReaderLabel.skipLastText prop to labelOverrides.skipToLastScreenReaderLabel.getLinkUrl prop, which has been deprecated.theme prop to the className prop. If it cannot, deletes the theme prop.For example:
import { Pagination } from '@americanexpress/dls-react6';
export default function Page() {
return (
<Pagination
selected={selectedPage}
total={100}
onChange={setSelectedPage}
skipFirstText="Custom skip first text"
previousText="Custom previous text"
nextText="Custom next text"
skipLastText="Custom skip last text"
getSelectedPageLabel={(selected, total) =>
`Custom selected page label: ${page} of ${total}`
}
getLinkUrl={(page) => `https://www.example.com/page/${page}`}
theme={{ color: 'red' }}
{...otherProps}
/>
);
}
Transforms into:
import { Pagination } from '@americanexpress/dls-react';
export default function Page() {
return (
<Pagination
id="unique-id-for-pagination"
selectedPage={selectedPage}
total={100} // needs manual change
onChange={setSelectedPage}
getSelectedPageLabel={(selected, total) =>
`Custom selected page label: ${page} of ${total}`
}
{...otherProps}
labelOverrides={{
skipToFirstScreenReaderLabel: 'Custom skip first text',
previousScreenReaderLabel: 'Custom previous text',
nextScreenReaderLabel: 'Custom next text',
skipToLastScreenReaderLabel: 'Custom skip last text',
}}
/>
);
}
The Pagination component now includes “Results Per Page” functionality by default. This significantly changes the behavior of the component. See the component documentation for more info on the “Results Per Page” functionality and other new props.
The total prop has been deprecated in favor of totalResults. The total prop was for the total number of pages, whereas the totalResults prop is for the total number of results.
Connect with the DLS Team on Slack or by email.
Check out additional resources.