> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/experience-cloud/experience-components/ax-button-group.md).

# AX - Button Group

## Overview

**AX - Button Group** is an Experience Cloud component that displays multiple related buttons together as a unified group on Experience Sites pages.

Use it to present related actions side-by-side—like "Save" and "Cancel," "Edit" and "Delete," or navigation options for different sections. Buttons stay visually connected as a single unit, making it clear they're related choices.

Perfect for form actions, record management options, tab-like navigation, or anywhere portal users need to choose between multiple related actions.

## Configuration

Follow these steps to tailor the Avonni Button Group Component to fit your Experience Cloud site's design and functionality perfectly:

### **Key Settings**

#### **Display as row**

Controls how the buttons sit next to one another. When enabled, they are rendered as separated items with spacing between them. When disabled, they are joined into a single compact group, flush against one another.

Both layouts are horizontal. The Button Group does not stack its buttons vertically. To lay buttons out in a vertical column, place a separate **AX - Button** component for each action in the region instead.

<figure><img src="https://2929066058-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDL6JQuZArjJeQvX2ot4y%2Fuploads%2FGcUKSoFFYli2aHdxG5WC%2Fax-button-group-display-as-row.png?alt=media" alt=""><figcaption><p>Display as row on, at the top, with the buttons separated. Off, underneath, with the same three buttons joined into one flush group.</p></figcaption></figure>

#### **Stretch**

When enabled, the group fills the width of its container and the buttons share the space between them. Leave it off to keep the group at its content width, which is what **Horizontal Alignment** positions.

Buttons that show only an icon keep their own width, so the labelled buttons take the extra space rather than leaving a gap around a centred icon.

#### **Horizontal Alignment**

Positions the button group within its container: left, center or right, shown in the panel as three alignment icons. It defaults to left, and acts on the group only while **Stretch** is off.

#### **Visible buttons**

This setting determines the maximum number of buttons directly visible on the screen. If you have more buttons than the specified number, the remaining ones will be placed in a convenient dropdown menu.

#### **Button Menu Attributes**

* **Label:** Set the text displayed on the button that opens the dropdown menu containing additional buttons.
* **Icon Name:** On the button menu, select an appropriate icon (refer to Salesforce Lightning Design System for available icons).
* **Variant:** Choose the visual style for the button menu — **Bare**, **Bare Inverse**, **Border**, **Border Filled**, **Border Inverse**, **Brand**, **Brand Outline**, **Container**, **Destructive**, **Destructive Text**, **Inverse**, **Neutral** (the default) or **Success**.
* **Menu Alignment:** Select how the dropdown menu is positioned relative to the button — **Auto**, **Left**, **Center**, **Right**, **Bottom Left**, **Bottom Center** or **Bottom Right**. The default, **Auto**, places the menu wherever it fits in the viewport.

#### **Buttons**

* **Label:** Enter the text you want to appear on the button.
* **Icon Name:** If desired, choose an icon to be placed on the button.
* **Icon Source:** Use your own image as the button's icon, instead of a Lightning Design System one.
* **Icon Position:** Specify whether the icon sits to the **Left** (the default) or the **Right** of the button label. It appears only once the button has a **Label**: an icon-only button has no label to position the icon against.
* **Variant:** Select the button's appearance — **Bare**, **Bare Inverse**, **Base**, **Border**, **Border Filled**, **Border Inverse**, **Brand**, **Brand Outline**, **Container**, **Destructive**, **Destructive Text**, **Inverse**, **Neutral** (the default) or **Success**.
* **Disabled:** Enable this setting if you want the button to start in a disabled state, preventing user interaction.
* **Hidden:** Enable this setting if you want the button to be initially hidden from view.
* **Title:** Tooltip text shown when a user hovers over the button.
* **Alternative Text:** Accessible text describing the button, read out by screen readers. Set it whenever the button shows an icon and no label.
* **On Click:** This crucial section allows you to define what happens when a user clicks on the button. Consult the "On Click Interactions" documentation page for a comprehensive list of possible actions and configurations.

### **Important Considerations**

* Design your Button Group with a clear visual hierarchy in mind. Use the **Brand** variant to emphasize primary actions.
* Use the **Destructive** variant sparingly for actions that have significant consequences.
* Ensure that button labels are concise and accurately describe their function.
* Always thoroughly test your Button Group configuration across different devices and browsers to ensure optimal user experience.

## Styling

The Avonni Button Group Component offers comprehensive styling options to customize its appearance within your Experience Cloud site. Below is a breakdown of available styling attributes:

{% tabs %}
{% tab title="Margin" %}
Controls the outer spacing around the group.
{% endtab %}

{% tab title="Padding" %}
Controls the inner spacing of the group.
{% endtab %}

{% tab title="Label/Icon" %}

* **color:** Sets the default text or icon color.
* **color active:** Sets the text or icon color when the button is active (clicked or focused).
* **color hover:** Sets the text or icon color when the user hovers the mouse over the button.
* **font family:** Specifies the font to be used for the button text.
* **font size:** Controls the size of the button text.
* **font style:** Sets the font style (e.g., normal, italic, oblique).
* **font weight:** Determines the boldness of the button text (e.g., normal, bold, bolder).
  {% endtab %}

{% tab title="Background" %}

* **color:** Sets the default background color of the button.
* **color active:** Sets the background color when the button is active.
* **color hover:** Sets the background color when the user hovers the mouse over the button.
  {% endtab %}

{% tab title="Border" %}

* **color:** Sets the default border color.
* **color active:** Sets the border color when the button is active.
* **color hover:** Sets the border color when the user hovers the mouse over the button.
* **size:** Controls the width of the border.
* **style:** Specifies the border style (e.g., solid, dashed, dotted).
  {% endtab %}
  {% endtabs %}

### **Example Usage**

To create a button group with a red background, white text, and a subtle hover effect, consider the following configuration:

```
Label/Icon:
   color: white
   color hover: #f5f5f5 

Background:
   color: red 

Border: 
   color: red  
```

### **Important Notes**

* Use a web color picker or generator to find your desired color codes.
* Strive for consistency with your Experience Cloud site's overall design and color scheme.
* Always test your styling changes to ensure the desired visual effect and accessibility.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/experience-cloud/experience-components/ax-button-group.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
