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
<div data-view-component="true" class="ButtonGroup">
<div>
<button id="icon-button-cff67960-d9d6-4a4a-b47c-a8ba9a53466d" aria-labelledby="tooltip-8ad7474d-e421-4675-a7e6-ce4cb8cc933c" 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-note Button-visual">
<path d="M0 3.75C0 2.784.784 2 1.75 2h12.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0 1 14.25 14H1.75A1.75 1.75 0 0 1 0 12.25Zm1.75-.25a.25.25 0 0 0-.25.25v8.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-8.5a.25.25 0 0 0-.25-.25ZM3.5 6.25a.75.75 0 0 1 .75-.75h7a.75.75 0 0 1 0 1.5h-7a.75.75 0 0 1-.75-.75Zm.75 2.25h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1 0-1.5Z"></path>
</svg>
</button><tool-tip id="tooltip-8ad7474d-e421-4675-a7e6-ce4cb8cc933c" for="icon-button-cff67960-d9d6-4a4a-b47c-a8ba9a53466d" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">button 1</tool-tip>
</div>
<div>
<button id="icon-button-d8d0d038-b363-4860-84e9-0a6146d43423" aria-labelledby="tooltip-d63bd8b8-1d1c-4618-a250-6ffe8c9ed396" 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-rows Button-visual">
<path d="M16 10.75v2.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25v-2.5C0 9.784.784 9 1.75 9h12.5c.966 0 1.75.784 1.75 1.75Zm0-8v2.5A1.75 1.75 0 0 1 14.25 7H1.75A1.75 1.75 0 0 1 0 5.25v-2.5C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75Zm-1.75-.25H1.75a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Zm0 8H1.75a.25.25 0 0 0-.25.25v2.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25v-2.5a.25.25 0 0 0-.25-.25Z"></path>
</svg>
</button><tool-tip id="tooltip-d63bd8b8-1d1c-4618-a250-6ffe8c9ed396" for="icon-button-d8d0d038-b363-4860-84e9-0a6146d43423" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">button 2</tool-tip>
</div>
<div>
<button id="icon-button-dcce9a46-b1f6-47e3-b8c5-c40e9472d33f" aria-labelledby="tooltip-86ffc799-9201-4fa9-8b2c-168ff2f2685b" 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-sort-desc Button-visual">
<path d="M0 4.25a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 4.25Zm0 4a.75.75 0 0 1 .75-.75h4.5a.75.75 0 0 1 0 1.5H.75A.75.75 0 0 1 0 8.25Zm0 4a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5H.75a.75.75 0 0 1-.75-.75ZM13.5 10h2.25a.25.25 0 0 1 .177.427l-3 3a.25.25 0 0 1-.354 0l-3-3A.25.25 0 0 1 9.75 10H12V3.75a.75.75 0 0 1 1.5 0V10Z"></path>
</svg>
</button><tool-tip id="tooltip-86ffc799-9201-4fa9-8b2c-168ff2f2685b" for="icon-button-dcce9a46-b1f6-47e3-b8c5-c40e9472d33f" popover="manual" data-direction="s" data-type="label" data-view-component="true" class="sr-only position-absolute">button 3</tool-tip>
</div>
</div>
1
2
3
4
5
render(Primer::Beta::ButtonGroup.new(size: size)) do |component|
component.with_button(icon: :note, "aria-label": "button 1")
component.with_button(icon: :rows, "aria-label": "button 2")
component.with_button(icon: "sort-desc", "aria-label": "button 3")
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);
}