Skip to content

Button

The wiz-button component is a flexible and customizable button component that works seamlessly across currently supported eWizard content item types (e-Detailers, emails). The button automatically adapts its rendering and behavior based on the channel context—rendering as an HTML table for email compatibility and as a div-based component for other content items.

The cross-channel button component has the following key features:

  • Flexible text with HTML markup support.

  • URL navigation with internal/external link handling.

  • Customizable sizing and alignment.

  • Full width option with mobile auto-detection.

  • Email link tracking through data attributes.

  • Channel-specific event handling.

Installation

The wiz-button component is part of the eWizard.js component library. To install it to your project, run the following command in the terminal:

wiz install @component/wiz-button

Register the component globally in your application or import it in your Vue template.

Properties

The wiz-button component has the following properties:

PropertyTypeDefaultDescription
componentNameString'Button'The display name for the component in d Editor interface. It identifies the component type (used for tracking and logging purposes).
textString'<span class="text-style_button"><b>Button</b></span>'The button label text. Supports HTML markup for advanced styling (e.g., bold, spans with custom classes).
linkString''URL for the button to navigate to when clicked. External links open in a new tab (_blank), while internal links starting with # open in the same window (_self).
widthNumber120Button width in pixels. This property is ignored when fullWidth is set to true.
minHeightNumber36Minimum button height in pixels. Only applies in e-Detailers
lineHeightNumber20Text line height in pixels. Controls vertical spacing within the button text.
textAlignString'center'Horizontal alignment of the text within the button. Accepts 'left', 'center', or 'right'.
alignString'left'Horizontal alignment of the button itself on the page. Accepts 'left', 'center', or 'right'.
fullWidthBooleanfalseWhen true, the button stretches to fill the full width of its container.
dataMsysLinknameString''Data attribute for email tracking and link naming in email marketing platforms (e.g., Marketo, Sailthru).

Custom events

The cross-channel button component emits the following custom events for interaction tracking and custom behavior:

EventPayloadDescription
clickNoneEmitted when the button is clicked. In e-Detailers, this event is triggered before attempting to navigate through the link property.

Channel-specific behavior

The cross-channel button component adapts its rendering and functionality based on the content item context.

  • Renders as a <div> with flexbox layout for modern styling.

  • Detects and respects absolute positioning contexts (does not apply alignment classes if positioned absolutely).

  • Click events are fully reactive and can trigger custom handlers.

  • Link navigation is sealed if custom actions or listeners are present.

Usage examples

To use the wiz-button cross-channel component in your project, add the following to the template section of the Vue file:

vue
<wiz-button
  text="<span class='text-style_button'><b>Click Me</b></span>"
  :width="150"
  align="center"
  link="https://example.com"
></wiz-button>

Notes

  • The button component automatically detects the content item context and renders appropriately without manual configuration.

  • Link navigation is prevented in the edit mode to allow editing without unwanted navigation.

  • Internal links (starting with #) and external links are handled automatically with appropriate target attributes.