react select customize css

Solutions on MaxInterview for react select customize css by the best coders in the world

showing results for - "react select customize css"
Cassius
29 Feb 2017
1const customStyles = {
2  menu: (provided, state) => ({
3    ...provided,
4    width: state.selectProps.width,
5    borderBottom: '1px dotted pink',
6    color: state.selectProps.menuColor,
7    padding: 20,
8      background : blue
9  }),
10
11  control: (_, { selectProps: { width }}) => ({
12    width: width
13  }),
14
15  singleValue: (provided, state) => {
16    const opacity = state.isDisabled ? 0.5 : 1;
17    const transition = 'opacity 300ms';
18
19    return { ...provided, opacity, transition };
20  }
21}
22
23  const App = () => (
24    <Select
25      styles={customStyles}
26      width='200px'
27      menuColor='red'
28      options={...}
29    />
30  );
31