带有标签的Material-ui文本字段 [英] Material-ui textfield with label

查看:226
本文介绍了带有标签的Material-ui文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉我如何在material-ui lib中制作带有标签的文本字段

Can anyone tell me how to make text field with label in material-ui lib

寻找这样的东西:

https://github.com/callemall/material-ui/blob/master/src/TextField/TextFieldLabel.jsx

但是在npm包中找不到它

but cant find it in the npm package

推荐答案

对于固定标签,您需要设置floatLabelFixed属性:

For a fixed label, you need to set the floatingLabelFixed prop:

<TextField
  floatingLabelText="Fixed Floating Label Text"
  floatingLabelFixed={true}
/>

有关详细信息,请参见 Textfield的文档中的简单示例" .

For more info, see 'Simple examples' in the docs for Textfield.

这篇关于带有标签的Material-ui文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆