[InputLabel] does not accept prop "size" in TypeScript
See original GitHub issueDuplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Current behavior 😯
I add the prop size=“small” to an InputLabel component, and TypeScript complains:
Expected behavior 🤔
TypeScript should accept “size” as a prop, since the prop does what it is supposed to. It is simply not added to the typing.
Steps to reproduce 🕹
Steps:
- Add an
<InputLabel>
component to the app. - Add
size="small"
as a prop to the component. - The component renders as expected.
- TypeScript is not happy.
Context 🔦
No response
Your environment 🌎
`npx @mui/envinfo`
System: OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (12) x64 Intel® Core™ i7-10750H CPU @ 2.60GHz Memory: 28.06 GB / 31.23 GB Container: Yes Shell: 5.8 - /usr/bin/zsh Binaries: Node: 16.13.1 - /usr/local/bin/node npm: 8.1.2 - /usr/local/bin/npm Managers: Apt: 2.0.6 - /usr/bin/apt Utilities: Make: 4.2.1 - /usr/bin/make GCC: 9.3.0 - /usr/bin/gcc Git: 2.25.1 - /usr/bin/git Virtualization: Docker: 20.10.9 - /usr/bin/docker IDEs: Nano: 4.8 - /usr/bin/nano Vim: 8.1 - /usr/bin/vim Languages: Bash: 5.0.17 - /usr/bin/bash Perl: 5.30.0 - /usr/bin/perl Python: 2.7.18 - /usr/bin/python Python3: 3.8.10 - /usr/bin/python3 Browsers: Chrome: 98.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
I see. That’s interesting.
I will look into it and let you know.
Hi. As you can see in InputLabel API doc, it doesn’t provide
size
prop.FormLabel
, to whichInputLabel
is extended, also doesn’t providesize
prop.FormControl
providessize
prop as can be seen in its API doc. You may have been confused with this.You can change the font-size of input label via
sx
prop. Check out https://codesandbox.io/s/composedtextfield-material-demo-forked-zk05i?file=/demo.js