Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Bootstrap: Label on the left side of checkbox

I use a checkbox from the React-Bootstrap library this way:

var checkBtn = ce(bootstrap.Input, {type: "checkbox", label: "Multiplied ",
checked: this.isChecked, id: "multBtn", onClick: this.onChange });

and I would like to have a label on the left side. How can I do this ?

like image 403
Bill Lumbert Avatar asked Jun 30 '15 10:06

Bill Lumbert


1 Answers

Had answered this in a different post before someone shared this question with me.

I used flex to solve this by changing the row direction.

HTML:

<div class="checkbox">
    <label title="">
        <input type="checkbox" value="">
        Did not perform
    </label>
</div>

CSS:

div.checkbox {
  display: inline-block;
  /*ie7 -- start*/
  *display: inline;
  zoom: 1;
}

div.checkbox > label {
  display: flex;
  flex-direction: row-reverse;
}

Output:

enter image description here

JSFiddle: here

You can find my original post/answer here

like image 82
kingisaac95 Avatar answered Oct 22 '22 11:10

kingisaac95