Skip to content

ButtonGroup

Use button group to render a series of buttons.
  • Beta
  • Not reviewed for accessibility

Use ButtonGroup to render a series of buttons.

Arguments

NameTypeDefaultDescription
variantSymbolnilDEPRECATED. One of :medium or :small.
sizeSymbol:mediumOne of :medium or :small.
system_argumentsHashN/ASystem arguments

Slots

buttons

Required list of buttons to be rendered.

NameTypeDefaultDescription
kwargsHashN/AThe same arguments as Button except for size and group_item.

Examples

Default

<%= render(Primer::Beta::ButtonGroup.new) do |component| %>
<% component.with_button { "Default" } %>
<% component.with_button(scheme: :primary) { "Primary" } %>
<% component.with_button(scheme: :danger) { "Danger" } %>
<% component.with_button(scheme: :outline) { "Outline" } %>
<% component.with_button(classes: "custom-class") { "Custom class" } %>
<% end %>

Sizes

<%= render(Primer::Beta::ButtonGroup.new(size: :small)) do |component| %>
<% component.with_button { "Default" } %>
<% component.with_button(scheme: :primary) { "Primary" } %>
<% component.with_button(scheme: :danger) { "Danger" } %>
<% component.with_button(scheme: :outline) { "Outline" } %>
<% end %>