x
1
2
3
4
5
<div class="group" role="group" aria-label="Basic example">
<button name="button" type="submit" class="btn">Profile</button>
<button name="button" type="submit" class="btn">Settings</button>
<button name="button" type="submit" class="btn">Message</button>
</div>
1
2
3
4
5
<div class="group" role="group" aria-label="Basic example">
<%= button_tag "Profile", class: "btn" %>
<%= button_tag "Settings", class: "btn" %>
<%= button_tag "Message", class: "btn" %>
</div>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
.group {
align-items: center;
display: flex;
:first-child {
border-end-end-radius: 0;
border-start-end-radius: 0;
}
:last-child {
border-end-start-radius: 0;
border-start-start-radius: 0;
}
:not(:first-child, :last-child) {
border-radius: 0;
margin-inline: -1px;
}
> :focus-visible {
z-index: 1;
}
}
Java Script is not required or multiple files are needed, check the notes.