Incorporating bootstrap toggle into my project has enhanced its functionality. However, I encountered an issue when attempting to align the toggle div to the right without affecting the positioning of the text on the left.
After researching possible solutions, I discovered that applying the clearfix
class could potentially resolve this problem. While it did address some alignment issues, the overall appearance still fell short of expectations.
For a closer look at the current layout, you can visit the following JSFiddle.
<ul class="list-group" style="width:200px">
<li class="list-group-item active">
<h5 class="list-group-item-heading">
<i class="fa fa-cogs"></i>
Settings
</h5>
</li>
<li class="list-group-item">
<h5 class="list-group-item-text clearfix">
Data source
<div class="toggle btn btn-primary" data-toggle="toggle" style="width: 0px; height: 0px;float: right;">
<input class="pull-right" type="checkbox" checked="" data-toggle="toggle">
<div class="toggle-group">
<label class="btn btn-primary toggle-on">On</label>
<label class="btn btn-default active toggle-off">Off</label>
<span class="toggle-handle btn btn-default"></span>
</div>
</div>
</h5>
</li>
</ul>
I envision the final design to resemble the visual in the image link below (disregarding the icon):