alby-single-button-embed

Allow customers a way to access your AI assistant with a simple button.

Prerequisites

  • Ensure alby is installed to unlock these elements and elevate your storefront. Learn more here.
  • This widget triggers the alby chatbot, please ensure that is setup before using this widget. You can set it up on the experiences page inside the alby dashboard.

Usage

The alby-single-button-embed component can be embedded in your webpage with the below example.

Basic Example

<alby-single-button-embed
  widget-id="widget-id"                 
</alby-single-button-embed>

CSS Variables Configuration

The alby-single-button-embed component can be customized using CSS custom properties (CSS variables). These variables allow you to control the appearance and behavior of the button without modifying the component's internal styles.

Usage

You can set these variables using inline styles on the component:

<alby-single-button-embed
  widget-id="widget-id"                 
  style="--alby-single-button-background: #007bff; --alby-single-button-hover-background: #0056b3"
></alby-single-button-embed>

Priority Order

CSS variables follow this priority order (highest to lowest):

  1. Inline styles - Set directly on the component element
  2. Widget styling - Configured through the Alby dashboard
  3. Default values - Built-in component defaults

Available CSS Variables

CSS VariableDescriptionDefault Value
--alby-single-button-widthSets the width of the buttonauto
--alby-single-button-heightSets the height of the buttonauto
--alby-single-button-backgroundSets the background color of the button#ffffff
--alby-single-button-text-colorSets the text color of the button#1f2937
--alby-single-button-border-radiusSets the border radius for rounded corners9999px
--alby-single-button-paddingSets the internal padding of the button8px 16px
--alby-single-button-gapSets the gap between the icon and text8px
--alby-single-button-border-widthSets the border width1px
--alby-single-button-border-colorSets the border color#e5e7eb
--alby-single-button-hover-backgroundSets the background color on hover#f9fafb
--alby-single-button-hover-text-colorSets the text color on hover#1f2937
--alby-single-button-font-sizeSets the font size of the button text16px
--alby-single-button-font-weightSets the font weight of the button text500
--alby-single-button-icon-displaySets the display property of the iconblock
--alby-single-button-icon-sizeSets the size of the icon20px
--alby-single-button-icon-colorSets the color of the icon#1f2937