import Autocomplete from "@mui/material/Autocomplete";
import { styled } from "@mui/material/styles";
const StyledAutocomplete = styled(Autocomplete)({
"& .MuiInputLabel-outlined:not(.MuiInputLabel-shrink)": {
// Default transform is "translate(14px, 20px) scale(1)""
// This lines up the label with the initial cursor position in the input
// after changing its padding-left.
transform: "translate(34px, 20px) scale(1);"
},
"&.Mui-focused .MuiInputLabel-outlined": {
color: "purple"
},
"& .MuiAutocomplete-inputRoot": {
color: "purple",
// This matches the specificity of the default styles at https://github.com/mui-org/material-ui/blob/v4.11.3/packages/material-ui-lab/src/Autocomplete/Autocomplete.js#L90
'&[class*="MuiOutlinedInput-root"] .MuiAutocomplete-input:first-of-type': {
// Default left padding is 6px
paddingLeft: 26
},
"& .MuiOutlinedInput-notchedOutline": {
borderColor: "green"
},
"&:hover .MuiOutlinedInput-notchedOutline": {
borderColor: "red"
},
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
borderColor: "purple"
}
}
});
export default function ComboBox() {
return (
<StyledAutocomplete />
);
}
참고 사이트
'Study > React' 카테고리의 다른 글
[React] frontend-maven-plugin 사용 시 Proxy 설정은? (0) | 2023.06.13 |
---|---|
[React] Chart.js Tooltip Callbacks (0) | 2023.06.11 |
[React] MUI Button과 IconButton 정사각형으로 만들기 (0) | 2023.06.07 |
[React] MUI Table 특정 Row의 border 지우기 (0) | 2023.06.07 |
[React] React에서 Chart.js 사용하기 (0) | 2023.05.09 |