react-select#Styles TypeScript Examples

The following examples show how to use react-select#Styles. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: styles.ts    From django-react-typescript with MIT License 6 votes vote down vote up
export function selectInputStyles(width?: number | string): Partial<Styles> {
  return {
    option: (provided, state) => ({
      ...provided,
      padding: 10,
    }),
    control: (provided, state) => ({
      width: width ? width : 320,
      display: "flex",
      border: `1.5px solid ${theme.color.grey8}`,
      borderRadius: 10,
      padding: "8px 13px",
    }),
    singleValue: (provided, state) => {
      const opacity = state.isDisabled ? 0.5 : 1;
      const transition = "opacity 300ms";

      return { ...provided, opacity, transition };
    },
  };
}