Skip to content
Justice Tech School

Button Groups

Wrap related buttons in .btn-group for a joined look, or .btn-group-vertical for a vertical stack. Use role="group" for accessibility.

Example
<div class="btn-group" role="group" aria-label="Basic">
  <button class="btn btn-secondary">Left</button>
  <button class="btn btn-secondary">Middle</button>
  <button class="btn btn-secondary">Right</button>
</div>

Exercise

Group class.

btn-

Quiz Test

Which role helps screen readers?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.