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 Search component to a v7 Search or v7 DefaultSearch component.
loading to isLoadinglabelText to labelbuttonSearch to showSearchButtondisabled to aria-disabledsearchButtonLabel to labelOverrides.searchButtonScreenReaderLabelclearButtonLabel to labelOverrides.clearButtonScreenReaderLabelshowLabelText prop. There must always be visible label text.theme prop to the className prop. If it cannot, deletes the theme prop.SearchResults component. SearchResult components should now be direct children of the Search component.Search has no children, renames component to DefaultSearch.For example:
import {
Search,
SearchResults,
SearchResult,
} from '@americanexpress/dls-react6';
export default function Page() {
return (
<Search
loading={loading}
labelText={labelText}
buttonSearch={buttonSearch}
disabled={disabled}
searchButtonLabel="Search"
clearButtonLabel="Clear Search"
showLabelText={showLabelText}
theme={{ color: 'red' }}
{...otherProps}
>
<SearchResults>
<SearchResult key="1" id="result-1" {...otherProps} />
<SearchResult key="2" id="result-2" {...otherProps} />
<SearchResult key="3" id="result-3" {...otherProps} />
</SearchResults>
</Search>
);
}
Transforms into:
import { Search, SearchResult } from '@americanexpress/dls-react';
export default function Page() {
return (
<Search
isLoading={loading}
label={labelText}
showSearchButton={buttonSearch}
aria-disabled={disabled}
labelOverrides={{
searchButtonScreenReaderLabel: 'Search',
clearButtonScreenReaderLabel: 'Clear Search',
}}
{...otherProps}
>
<SearchResult key="1" id="result-1" {...otherProps} />
<SearchResult key="2" id="result-2" {...otherProps} />
<SearchResult key="3" id="result-3" {...otherProps} />
</Search>
);
}
Connect with the DLS Team on Slack or by email.
Check out additional resources.