I'm trying to center-align the label in this TextField:
import React from "react";
import { withStyles } from "@material-ui/core/styles";
import TextField from "@material-ui/core/TextField";
export default function BasicTextField() {
return (
<TextField
id="standard-basic"
label="Standard"/>
);
}
Initially, I managed to right-align the label:
import React from "react";
import { withStyles } from "@material-ui/core/styles";
import TextField from "@material-ui/core/TextField";
const StyledTextField = withStyles({
root: {
"& label": {
transformOrigin: "top right",
right: "0",
left: "auto"
}
}
})(TextField);
export default function BasicTextField() {
return (
<StyledTextField
id="standard-basic"
label="Standard"/>
);
}
Is there a way to horizontally center-align the label?