'How to make Material UI Drop down menu semi transparent?
I've been tinkering for the past 30 minutes trying to make my Select components drop down menu semi transparent, but to no avail. I tried changed the Paper component, then the Menu, then MenuList props but it doesn't seem to support a change in opacity. Here's what my code looks like:
<TextField
id="outlined-select-links"
required
error={false}
select
InputLabelProps={{ shrink: true }}
size="small"
sx={{ width: 400, mt: 1, mb: 4 }}
label="Links"
helperText="Please select an account to link to your profile. 1 minimum."
SelectProps={{
multiple: true,
value: links,
MenuProps: {
TransitionComponent: Fade,
PaperProps: {
sx: {
opacity: 0.1,
},
},
},
onChange: handleLinkChange,
renderValue: (selected) => (
<Box sx={{ display: "flex", flexWrap: "wrap", gap: 0.5 }}>
{selected.map((value) => (
<Chip key={value} label={value} />
))}
</Box>
),
}}
>
{accounts.map((option) => (
<MenuItem key={option} value={option} sx={{ my: -1 }}>
<Checkbox checked={links.indexOf(option) > -1} />
<ListItemText primary={option} />
</MenuItem>
))}
</TextField>
I've targeted MenuProps and managed to change the paper color to red as a test, but I still can't figure out how to just make it slightly transparent. At most, changing the opacity only effects the MenuItems but not the paper menu underneath. Any tips?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
