Skip to content

Button

The Button AEM component is designed to be used only within AEM. It uses properties that come directly from the dialog options in the authoring interface. It handles styling possibilities and accessibility features based on the button type and link behavior (external, overlay, etc.).

The regular label comes from the link model.

PropTypeDescriptionOptional
linkModelLinkModelConfiguration object for the button’s link behavior
styleIdsStyleId[]Array of style IDs to determine button appearance. These values come from the styling choice in the author (primary, secondary, tertiary)
idstringUnique identifier for the button element
mobileLabelstringAlternative text label for mobile devices (≤576px)
accessibilityLabelstringCustom ARIA label for screen readers
opensInNewWindowLabelstringScreen reader text for links that open in new windows. This label should come from i18n
import type { AEMComponentProperties } from '@dcx-be/aem-react-components';
import { ButtonAem } from '@tmedxp/aem-react-components/atoms/button';
import type { ButtonModel } from './types/button.model';
const Button = ({ model }: AEMComponentProperties<ButtonModel>) => {
return (
<ButtonAem
linkModel={model.linkModel}
styleIds={model.styleIds}
id={model.id}
mobileLabel={model.mobileLabel}
accessibilityLabel={model.accessibilityLabel}
opensInNewWindowLabel={'a11yOpensInNewWindow'}
/>
);
};
export { Button };