Source:  Twitter logo

I am trying to have a radio button next to a text input so essentially a user can input "answers" to a question and mark one preferred. However, Material-UI puts each on it's own line.

This is what I currently have :

<div>
   <RadioButton
      value="light"
   />
   <TextInput
       hintText="Answer"
       multiLine = {true}
   />
</div>

Just for the record, I managed to align radio buttons using flexboxgrid... Did something like this:

      <div className="row">
        <div className="col-md-2">
          Type:
        </div>
        <div className="col-md-10">
          <RadioButtonGroup
             className="row"
             name="type">
            <RadioButton
               className="col-md-4"
               value="other"
               label="Other" />
            <RadioButton
               className="col-md-4"
               value="custom"
               label="Custom" />
          </RadioButtonGroup>
        </div>
      </div>
5 users liked answer #0dislike answer #05
roboli profile pic
roboli

I'm using react-inline-grid for layout with material-ui, it helps solve many problems and makes code more explicit about layout (plus it's reactive).

<Grid>
  <Row is="nospace start">
    <Cell is="9 tablet-6 phone-3">
       <TextField ... />
    </Cell>
    <Cell is="middle 3 tablet-2 phone-1">
       <RaisedButton ... />
    </Cell>
  </Row>
</Grid>
5 users liked answer #1dislike answer #15
Chris Hartwig profile pic
Chris Hartwig

You have a style object available to override the default styles of the element in Material-Ui. Use that and set display to inline-block.

display: inline-block;
2 users liked answer #2dislike answer #22
WitVault profile pic
WitVault

Copyright © 2022 QueryThreads

All content on Query Threads is licensed under the Creative Commons Attribution-ShareAlike 3.0 license (CC BY-SA 3.0).