Skip to content

Develop

The main button component with three visual variants for different emphasis levels.

<button class="tng-button">Button</button>
<a class="tng-button" href="#">Button</a>
Button

The default scheme is primary.

<button class="tng-button is-primary">Primary</button>
<button class="tng-button is-secondary">Secondary</button>
<button class="tng-button is-tertiary">Tertiary</button>
<button class="tng-button is-tertiary is-ghost">
Tertiary Ghost
</button>

The default size is lg.

<button class="tng-button is-sm">Small</button>
<button class="tng-button is-md">Medium</button>
<button class="tng-button is-lg">Large</button>
<button class="tng-button is-primary" disabled>Primary</button>
<button class="tng-button is-secondary" disabled>Secondary</button>
<button class="tng-button is-tertiary" disabled>Tertiary</button>
<button class="tng-button is-tertiary is-ghost" disabled>
Tertiary Ghost
</button>
<button class="tng-button is-primary">
<i class="tng-icon icon-download" aria-hidden="true"></i>
<span>Download</span>
</button>
<button class="tng-button is-secondary">
<span>Save</span>
<i class="tng-icon icon-bookmark" aria-hidden="true"></i>
</button>
<button class="tng-button is-tertiary">
<i class="tng-icon icon-external-link" aria-hidden="true"></i>
<span>External Link</span>
</button>

You can set overflow limitation on a button just like any other element by using the overflow utility class.

<button class="tng-button">
<div class="tng-overflow-ellipsis"></div>
</button>

The Button is one of the most important interactive elements in the design system. It enables users to take action — for example, saving changes, submitting a form, or moving forward in a process.

There are two main ways a Primary Button can appear:

  • As a Button: used when the action happens within the same page (e.g. opening a modal, submitting data).
  • As a Link styled as a Button: used when the action takes the user to another page or an external website.

The Tertiary Button includes an optional underline that can be toggled on or off through the boolean property “isGhost”. This ensures consistent behaviour and appearance while simplifying maintenance and documentation across Figma and development.

ButtonProperties extends <React.ButtonHTMLAttributes<HTMLButtonElement>> which means it includes all standard HTML attributes that can be applied to a button element.

PropTypeDescriptionOptional
textstringThe text label displayed inside the pill button
buttonStyle'primary' | 'secondary' | 'tertiary'The button style, 'primary' by default
buttonSize'sm' | 'md' | 'lg'Defines the size of the button, 'md' by default
buttonType'button' | 'link'Defines the type of node to render
trailingIconToyotaIcon | LexusIconIcon displayed after the text
leadingIconToyotaIcon | LexusIconIcon displayed before the text
isGhostbooleanIndicates if the tertiary button has the underline style
classNameClassValueCustom class names applied to the button element
import { Button } from '@tmedxp/react-components';
const ButtonExample = () => {
return <Button buttonType="button" text="Main Button" />;
};
export { ButtonExample };

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 };