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-062fb908-6822-4d4f-b529-2613e2f75f8a" aria-labelledby="tooltip-4a3ba330-cf9a-4043-998a-e1d45659e395" 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-4a3ba330-cf9a-4043-998a-e1d45659e395" for="icon-button-062fb908-6822-4d4f-b529-2613e2f75f8a" 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);
}