Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change react-select tag border radius

I'm trying to override react-select styles to achieve rounded multiValue tags.

So I went ahead and edited the multiValue style attribute like this:

const customStyles = {
    multiValue: (styles) => ({
        ...styles,
        backgroundColor: blue,
        borderRadius: "50%",
    }),
}

The background color works perfectly and the tag becomes blue. However the border radius is always stuck at 2px...

<Select
    options={options}
    styles={customStyles}
    isMulti
/>

How to override the default 2px border-radius imposed by react-select

like image 253
Bassem Avatar asked Feb 22 '26 22:02

Bassem


1 Answers

It turned out that I was overriding the background color of the multiValueLabel, which was somehow hiding the overridden border-radius in multiValue. Removing the backgroundColor attribute from the multiValueLabel solved the issue.

like image 163
Bassem Avatar answered Feb 25 '26 13:02

Bassem



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!