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-4dfe5c87-6597-4135-9f66-1b67e3ae2230" aria-labelledby="tooltip-09eb40eb-ac12-452c-a703-b1b0b7c4d51c" 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-09eb40eb-ac12-452c-a703-b1b0b7c4d51c" for="icon-button-4dfe5c87-6597-4135-9f66-1b67e3ae2230" 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
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);
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);
}