make btn-group responsive

Robert Rouge picture Robert Rouge · Mar 8, 2018 · Viewed 10.5k times · Source

I have a very long list of buttons and I need to group them, but also display them nicely. And right now, The design doesn't split in rows. I have bootstrap 4

<div class="btn-group" data-toggle="buttons">
          <label class="btn btn-primary">
            <input type="checkbox" name="bla" id="2" autocomplete="off" value="2" > bla bla
          </label>
          <label class="btn btn-primary">
            <input type="checkbox" name="bla2" id="2" autocomplete="off" value="2" > bla bla
          </label>
... (and so on)

Thanks

Answer

Jason Conville picture Jason Conville · Jun 15, 2018

Add the .flex-wrap class to your button group container.

<div class="btn-group flex-wrap" data-toggle="buttons">