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

# Button group

Button group is used to gather multiple actions.

&#x20;

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FTsx1Cx01tHHVNzfZTB9P%2FButtonGroup%20Hero.png?alt=media&amp;token=b87e988b-6114-4592-bbf7-59b46e4b553d" alt=""><figcaption><p>Button Group with primary and secondary actions</p></figcaption></figure>

## Overview <a href="#id-86d47b" id="id-86d47b"></a>

Use Button group when you have to display multiple buttons located in the same space. Button Group will help to space buttons out evenly.

It can contain the following combinations:

* 1 `Primary Button` + 1 `Secondary button` : when two actions are available, but one is more important than the other
* 2 `Secondary Buttons` : when two actions are available, and none is more important
* 1 `Primary Button` **OR** 1 `Secondary Button` + 1 [`Menu Button`](/design/components/actions/buttons.md#menu-button)`:` when there are more than two actions available, but one stands out, and others are regrouped in a sub-menu
* 2 `buttons` + 1 [`Menu Button`](/design/components/actions/buttons.md#menu-button)

&#x20;

<figure><img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FCmkR6sULmZsVN7KOUHlR%2FButtonGroup%20Example.png?alt=media&amp;token=8c83193f-69ec-445d-a49e-3cdcc708b94f" alt=""><figcaption></figcaption></figure>

## Guidelines <a href="#id-34aafc" id="id-34aafc"></a>

Buttons must be displayed in order of importance :

* `Primary Button` , if there is any, should always be displayed as the group's first action. ⚠️ Only one primary Action Button can be used in a Button Group.
* The `Secondary Button` comes afterward
* `Menu Button` comes last

💡 Please keep in mind that depending on the context, `Button group`can be displayed from left to right or from right to left.

{% hint style="success" %}
Use only one primary action

&#x20;![](https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FlCBGhyjHSogrS2aYwq5P%2FButtonGroup%20Example%201.png?alt=media\&token=227dbaac-338d-4e3b-9bd5-8a7d8327bdad)
{% endhint %}

{% hint style="success" %}
Put primary action as the first button of the group

&#x20;![](https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2FT0UvB9wsWBHyIKAPQ7Hp%2FButtonGroup%20Example%202.png?alt=media\&token=e4c92f69-0257-4314-a6aa-7bd7086e392f)
{% endhint %}

{% hint style="danger" %}
Do not use 2 primary actions

<img src="https://1297765105-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMoZPkWOmnKvoMWGW4aeM%2Fuploads%2F9aO3WBSxhGt3FXBI7g9k%2FButtonGroup%20Dont.png?alt=media&amp;token=458c6969-f287-403a-bf79-0ad171fa1950" alt="" data-size="original">
{% endhint %}

## Accessibility <a href="#id-34aafc" id="id-34aafc"></a>

While it's not a formal WGAC rule, it's considered good practice to maintain a minimum 8px spacing between buttons to prevent accidental clicks. This spacing is automatically managed by ROMA, so please avoid altering it for larger or smaller gaps

## Content <a href="#id-34aafc" id="id-34aafc"></a>

Button group content must follow [button guidelines](/design/components/actions/buttons.md#content).


---

# 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://design.mirakl.com/design/components/actions/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.
