Set TextField height material-ui

后端 未结 7 2168
一生所求
一生所求 2020-12-16 11:04

index.js

import React from \'react\'
import TextField from \'@material-ui/core/TextField\'
import style from \'./style\'
import withStyles          


        
相关标签:
7条回答
  • 2020-12-16 11:32

    This works with material-ui v3,

    <div className="container">
      <TextField
        label="Full name"
        margin="dense"
        variant="outlined"
        autoFocus
      />
    </div>
    

    .css

    .container input {
      height: 36px;
      padding: 0px 14px;
    }
    
    .container label {
      height: 36px;
      top: -6px;
    }
    
    .container label[data-shrink="true"] {
      top: 0;
    }
    

    https://codesandbox.io/s/elated-kilby-9s3ge

    0 讨论(0)
提交回复
热议问题