Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div data-view-component="true" class="ButtonGroup">
<div>
<button type="button" data-view-component="true" class="Button--secondary Button--medium Button"> <span class="Button-content">
<span class="Button-label">Main menu</span>
</span>
</button>
</div>
<div>
<action-menu data-select-variant="none" data-view-component="true">
<focus-group direction="vertical" mnemonics retain>
<button id="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-button" popovertarget="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-overlay" aria-controls="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-list" aria-haspopup="true" aria-labelledby="tooltip-6c7b2d33-e032-46f6-8367-a5ab7fb1af7b" type="button" data-view-component="true" class="Button Button--iconOnly Button--secondary Button--medium"> <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-triangle-down Button-visual">
<path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path>
</svg>
</button><tool-tip id="tooltip-6c7b2d33-e032-46f6-8367-a5ab7fb1af7b" for="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-button" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">secondary menu</tool-tip>
<anchored-position id="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-overlay" anchor="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-button" align="end" side="outside-bottom" anchor-offset="normal" popover="auto" data-view-component="true">
<div data-view-component="true" class="Overlay Overlay--size-auto">
<div data-view-component="true" class="Overlay-body Overlay-body--paddingNone"> <action-list>
<div data-view-component="true">
<ul aria-labelledby="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-button" id="action-menu-3657bedc-de6b-45b6-a40d-413a3136bd03-list" role="menu" data-view-component="true" class="ActionListWrap--inset ActionListWrap">
<li data-targets="action-list.items" data-item-id="item1" role="none" data-view-component="true" class="ActionListItem">
<button tabindex="-1" id="item-a72c0171-eee7-4106-b565-0c313aefbdf0" type="button" role="menuitem" data-view-component="true" class="ActionListContent">
<span data-view-component="true" class="ActionListItem-label">
Item 1
</span></button>
</li>
<li data-targets="action-list.items" data-item-id="item2" role="none" data-view-component="true" class="ActionListItem">
<button tabindex="-1" id="item-67206c42-67e5-43d3-a79a-ce986ead3ac1" type="button" role="menuitem" data-view-component="true" class="ActionListContent">
<span data-view-component="true" class="ActionListItem-label">
Item 2
</span></button>
</li>
</ul>
</div>
</action-list>
</div>
</div>
</anchored-position> </focus-group>
</action-menu>
</div>
</div>
1
2
3
4
5
6
7
<%= render(Primer::Beta::ButtonGroup.new(scheme: scheme, size: size)) do |component| %>
<% component.with_button { "Main menu" } %>
<% component.with_menu_button(button_arguments: { "aria-label": "secondary menu" }, menu_arguments: { anchor_align: :end }) do |menu, button| %>
<% menu.with_item(label: "Item 1", item_id: :item1) %>
<% menu.with_item(label: "Item 2", item_id: :item2) %>
<% end %>
<% end %>
Param Description Input

app/components/primer/beta/button_group.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.ButtonGroup {
display: inline-flex;
}
.ButtonGroup .Button {
margin-inline-end: -1px;
position: relative;
border-radius: 0;
}
.ButtonGroup .Button:focus,
.ButtonGroup .Button:active,
.ButtonGroup .Button:hover {
z-index: 1;
}
.ButtonGroup > :first-child .Button {
border-top-left-radius: var(--borderRadius-medium,0.375rem);
border-bottom-left-radius: var(--borderRadius-medium,0.375rem);
}
.ButtonGroup > :last-child .Button {
border-top-right-radius: var(--borderRadius-medium,0.375rem);
border-bottom-right-radius: var(--borderRadius-medium,0.375rem);
}