Previews

No matching results.

x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<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">Button 1</span>
</span>
</button>
</div>
<div>
<button id="icon-button-a069885a-9e2c-4bb9-8e6a-7b0a25d0d238" aria-labelledby="tooltip-68e6e803-4320-4547-b2b2-7eb87af2fb6a" 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-68e6e803-4320-4547-b2b2-7eb87af2fb6a" for="icon-button-a069885a-9e2c-4bb9-8e6a-7b0a25d0d238" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">menu</tool-tip>
</div>
</div>
1
2
3
4
render(Primer::Beta::ButtonGroup.new(size: size)) do |component|
component.with_button { "Button 1" }
component.with_button(icon: "triangle-down", "aria-label": "menu")
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
.ButtonGroup {
display: inline-flex;
}
.ButtonGroup .Button {
/* stylelint-disable-next-line primer/spacing */
margin-inline-end: -1px;
position: relative;
border-radius: 0;
}
:is(.ButtonGroup .Button):focus,:is(.ButtonGroup .Button):active,:is(.ButtonGroup .Button):hover {
z-index: 1;
}
.ButtonGroup > :first-child .Button {
border-top-left-radius: var(--borderRadius-medium);
border-bottom-left-radius: var(--borderRadius-medium);
}
.ButtonGroup > :last-child .Button {
border-top-right-radius: var(--borderRadius-medium);
border-bottom-right-radius: var(--borderRadius-medium);
}