Skip to content

Use ButtonGroup to render a series of buttons.

Arguments

NameTypeDefaultDescription
variantSymbolnilDEPRECATED. One of :medium and :small.
sizeSymbol:mediumOne of :medium and :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::ButtonGroup.new) do |component| %>
<% component.button { "Default" } %>
<% component.button(scheme: :primary) { "Primary" } %>
<% component.button(scheme: :danger) { "Danger" } %>
<% component.button(scheme: :outline) { "Outline" } %>
<% component.button(classes: "custom-class") { "Custom class" } %>
<% end %>

Sizes

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