ButtonGroup

The Bootstrap button group component, implemented in Ruby. Use it like any other matestack component in your apps, pages and components. It offers customizable options to simply achieve what is possible in bootstrap with this component. See below for more information about the possible options.

bs_btn_group(*args, &block)

Returns a bootstrap button-group containing content specified by a block. Also the button_group is customizable with the following options.

Optional options

  • size - Use :sm (small), :md (medium), :lg (large) to change size of the button group. The default is nil.

  • toolbar - Set true for using button toolbar instead of button group

  • label - Expects a String. Adding label to attributes aria-label

  • vertical - Expects true or false. By default is set as true. This parameter determines whether the button group should align vertically

  • Html attributes - all w3c confirm html attributes for div's can be set via options and will be added to the surrounding button group div.

Examples

Example 1:

bs_btn_group label: "Basic example" do
  bs_btn "Left", variant: :secondary
  bs_btn "Middle", variant: :secondary
  bs_btn "Right", variant: :secondary
end

returns

Example 2: Using size

returns

Example 3: Button Toolbar

returns

Last updated