简体   繁体   中英

semantic ui react, how to change label position?

Is it possible to change label position from right side to the left? I've tried to use float: left but it doesn't work.

import {Radio } from "semantic-ui-react"
<Radio label="in progress" toggle />

在此处输入图片说明

Can be done, have to do it a bit hacky way. Here is how it can be done.

const RadioExampleRadio = () => (
  <div class="radio-block">
    {" "}
    <label className="radio-label">Radio Label</label>
    <Radio />
  </div>
);

Have to add some css to make it look better

.radio-block{
  display: flex;
  align-items: center;
}
.radio-label{
  margin-right: 10px;
}

From semantic's documentation, there doesn't seem to be any comment on changing the position of the label on the radio button. It can be done this way though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM