-
Material UI text fields have a variant prop that changes the way look - i.e. filled, outlined, standard. Is it possible to pass this to inputs via the uiSchema? If not, is it possible to wrap the schema generated components in a ThemeProvider that just assigned a prop like variant? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hi @timayy , Yes you can pass any prop mentioned to change the text fields. There are 2 options:
You can also read more about overriding attributes using theme from Material UI Docs. My recommendation would be to go 2nd way to be consistent and use theme overrides. I hope this answers your question @timayy. Thanks for raising it. You can also read more in this issue #361 where uiSchema was used but in your case theme override would be better option. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the thorough answer, @vip-git. I appreciate it. I know this isn't the place to ask, but before I make an issue, I thought I'd quick ask you - I can't for the life of me get this package to work; both the latest main or next package. I've matched all the dependencies in a
This code is identical to your Basic Example Usage. But this error happens from just simply importing the package anywhere. Identical error if using Only think I can think of is react create app uses an older webpack version compared to what you have in your devDependencies. |
Beta Was this translation helpful? Give feedback.
Hi @timayy ,
Yes you can pass any prop mentioned to change the text fields.
There are 2 options:
mui:variant
attribute in uiSchemaExample can be seen here for multiline .
Example can be seen here
You can also read more about overriding attributes using theme from Material UI Docs.
My recommendation would be to go 2nd way to be consistent and use theme overrides.
I hope this answers your question @timayy. Thanks for raising it.
You can also read more in this issue #361 where uiSchema was used but in your case theme override wo…