Set Material UI Select width?

If you are doing something a one-off styling, you can use the inline style, it worked for me.

<FormControl style={{minWidth: 120}}> // this line
    <InputLabel htmlFor="selected-language">Language</InputLabel>
    <Select value={this.state.selectedLanguage}
            onChange={(e) => this.onLanguageChange(e.target.value)}
            inputProps={{
                name: 'language',
                id: 'selected-language',
            }}>
        {menuItems}
    </Select>
</FormControl>

enter image description here

If you would reuse it in more code and want to avoid code duplication, you will probably want to work with Themes

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)