Button Group

Groups multiple buttons together to manage their alignment, spacing, and placement.
---
block:
  _bookshop_name: layouts/button-group
  direction: row
  align: start
  gap: null
  button_blocks:
    - _bookshop_name: elements/button
      label: Primary
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: primary
      outline: false
    - _bookshop_name: elements/button
      label: Secondary
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: secondary
      outline: true
---
{% bookshop "{{block._bookshop_name}}" bind: block %}

Properties

button_blocksobject array

An array of button objects.

directionenum

The direction to list the buttons.

alignenum

The alignment of the buttons.

gapenum

The spacing between buttons.

marginobject

The spacing above and below the buttons.

Examples

Alignment

---
block:
  _bookshop_name: layouts/button-group
  direction: row
  align: start
  gap: null
  button_blocks:
    - _bookshop_name: elements/button
      label: Primary button
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: primary
      outline: true
    - _bookshop_name: elements/button
      label: Secondary button
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: secondary
      outline: true
---
{% bookshop "{{block._bookshop_name}}" bind: block %}
---
block:
  _bookshop_name: layouts/button-group
  direction: row
  align: center
  gap: null
  button_blocks:
    - _bookshop_name: elements/button
      label: Primary button
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: primary
      outline: true
    - _bookshop_name: elements/button
      label: Secondary button
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: secondary
      outline: true
---
{% bookshop "{{block._bookshop_name}}" bind: block %}
---
block:
  _bookshop_name: layouts/button-group
  direction: row
  align: end
  gap: null
  button_blocks:
    - _bookshop_name: elements/button
      label: Primary button
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: primary
      outline: true
    - _bookshop_name: elements/button
      label: Secondary button
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: secondary
      outline: true
---
{% bookshop "{{block._bookshop_name}}" bind: block %}

Direction

---
block:
  _bookshop_name: layouts/button-group
  direction: row
  align: start
  gap: null
  button_blocks:
    - _bookshop_name: elements/button
      label: Primary button
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: primary
      outline: true
    - _bookshop_name: elements/button
      label: Secondary button
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: secondary
      outline: true
---
{% bookshop "{{block._bookshop_name}}" bind: block %}
---
block:
  _bookshop_name: layouts/button-group
  direction: column
  align: start
  gap: null
  button_blocks:
    - _bookshop_name: elements/button
      label: Primary button
      link: null
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: primary
      outline: true
    - _bookshop_name: elements/button
      label: Secondary button
      icon:
        display_mode: null
        position: null
        name: null
      size: null
      type: secondary
      outline: true
---
{% bookshop "{{block._bookshop_name}}" bind: block %}