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 the v6 RadioGroup component to the v7 RadioGroup component.
checked prop to valuedefaultChecked prop to defaultValue.Legend subcomponent into the legend prop of the RadioGroup, if it exists.theme prop to the className prop. If it cannot, deletes the theme prop.For example:
import { RadioGroup } from '@americanexpress/dls-react6';
export default function Page() {
return (
<RadioGroup
checked={currentValue}
defaultChecked={defaultValue}
theme={{ color: 'red' }}
{...otherProps}
>
<Legend>Some Legend</Legend>
{/** Other Children */}
</RadioGroup>
);
}
Transforms into:
import { RadioGroup } from '@americanexpress/dls-react';
export default function Page() {
return (
<RadioGroup
value={currentValue}
defaultValue={defaultValue}
legend={<>Some Legend</>}
{...otherProps}
>
{/** Other Children */}
</RadioGroup>
);
}
There are new props for handling the legend associated with a group of radio buttons. Move the text contents of the associated Legend component to the legend prop of the RadioGroup component. If the legend should be hidden, set the isLegendHidden prop to true.
Previously, the onChange callback provided a second parameter in the callback which provided event.target.value. If your application was previously relying on this second parameter, switch to directly referencing event.target.value:
Switch from this:
<RadioGroup onChange={(event, value) => setValue(value)} />
To this:
<RadioGroup onChange={(event) => setValue(event.target.value)} />
Connect with the DLS Team on Slack or by email.
Check out additional resources.