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 DataTableV2 component to a v7 DataTable component.
DataTableV2 to DataTable.sortable prop to isSortable.checkable prop to isCheckable.expandable prop to isExpandable.sortBy prop to sortById.onRowCheckChange prop to onIsCheckedChange. See manual changes below.onHeaderRowCheckChange prop to onSelectAllCheckChange. See manual changes below.getSortByLabel prop to labelOverrides.getSortLabelScreenreaderText.striped prop to zebraStripes and attempts to update its value. See manual changes below.bordered prop to borders and attempts to update its value. See manual changes below.small prop to density and attempts to update its value. See manual changes below.theme prop to the className prop. If it cannot, deletes the theme prop.For example:
import { DataTableV2 } from '@americanexpress/dls-react6';
export default function Page() {
return (
<DataTableV2
id="data-table-id"
sortable={sortable}
checkable={checkable}
expandable={expandable}
sortBy={sortBy}
onRowCheckChange={() => {}}
onHeaderRowCheckChange={() => {}}
onExpandRowClick={() => {}}
getSortByLabel={() => {}}
striped={striped}
bordered={bordered}
small={small}
theme={{ color: 'red' }}
{...otherProps}
>
{/** Children */}
</DataTableV2>
);
}
Transforms into:
import { DataTable } from '@americanexpress/dls-react';
export default function Page() {
return (
<DataTable
id="data-table-id"
isSortable={sortable}
isCheckable={checkable}
isExpandable={expandable}
sortById={sortBy}
onIsCheckedChange={() => {}}
onSelectAllCheckChange={() => {}}
onExpandRowClick={() => {}}
zebraStripes={striped}
borders={bordered}
density={small}
labelOverrides={{
getSortLabelScreenreaderText: () => {},
}}
{...otherProps}
>
{/** Children */}
</DataTable>
);
}
The onRowCheckChange prop has been renamed to onIsCheckedChange and the function signature has been updated. Remove the first parameter event from the function signature.
The onHeaderRowCheckChange prop has been renamed to onSelectAllCheckChange and the function signature has been updated. Remove the first parameter event from the function signature.
The onExpandRowClick prop function signature has been updated. Remove the first parameter event from the function signature.
The striped prop has been renamed to zebraStripes. Its valid values are 'rows' | 'columns' | 'none'.
The bordered prop has been renamed to borders. Its valid values are 'all' | 'columns' | 'rows' | 'none'.
The small prop has been renamed to density. Its valid values are 'default' | 'compact'.
Connect with the DLS Team on Slack or by email.
Check out additional resources.