Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

React-Select confusing color options

I am using React-Select library and there are codes like this:

<SortableSelect
            useDragHandle
            axis="xy"
            onSortEnd={onSortEnd}
            distance={4}
            getHelperDimensions={({ node }) => node.getBoundingClientRect()}
            isMulti
            options={selectableData}
            labelKey="username"
            onChange={onChange}
            components={{
                MultiValue: SortableMultiValue,
                MultiValueLabel: SortableMultiValueLabel,
            }}

            className={classOfSelect}

            defaultValue={ selectableData && selectableData.length >= 2
                ? [selectableData[0], selectableData[1]]
                : []}
            closeMenuOnSelect={false}

        /> 

I have read the official document however It is not well detailed document and couldn’t find anything about it.
How can I change color my component?

Assigning color to my component.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I had the same issue for me . Luckily, I had added a few comments to my code. These are:

<SortableSelect
 theme={(theme) => ({
                ...theme,
                borderRadius: "6px",
                colors: {
                    ...theme.colors,
                    primary25: 'gray', // Selectable options backgroundColor  when hovered
                    primary: 'green', //outer border,close and dropdown icon color when page focused
                    neutral0:"red", //main container backgroundColor
                    neutral20: "red", // outer border,close and dropdown icon color when page reloaded
                    neutral60: "green", //outer border,close and dropdown icon color when elements hovered
                },
            })}
 />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading