@types/react-select

  • Version 4.0.15
  • Published
  • 83.3 kB
  • 4 dependencies
  • MIT license

Install

npm i @types/react-select
yarn add @types/react-select
pnpm add @types/react-select

Overview

TypeScript definitions for react-select

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Variables

variable components

const components: Components;

    variable defaultTheme

    const defaultTheme: Theme;

      Functions

      function createFilter

      createFilter: (
      config: Config | null
      ) => (option: Option, rawInput: string) => boolean;

        function mergeStyles

        mergeStyles: <
        OptionType extends OptionTypeBase,
        IsMulti extends boolean,
        GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
        >(
        source: StylesConfig<OptionType, IsMulti, GroupType>,
        target: StylesConfig<OptionType, IsMulti, GroupType>
        ) => StylesConfig<OptionType, IsMulti, GroupType>;
        • Merge Utility - Allows consumers to extend a base Select with additional styles

        Classes

        class NonceProvider

        class NonceProvider extends Component<NonceProviderProps> {}

          class StateManager

          class StateManager<
          OptionType extends OptionTypeBase = { label: string; value: string },
          IsMulti extends boolean = false,
          GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>,
          T extends SelectBase<OptionType, IsMulti> = SelectBase<OptionType, IsMulti>
          > extends Component<
          StateProps<SelectProps<OptionType, IsMulti, GroupType>> &
          Props<OptionType, IsMulti, GroupType> &
          SelectProps<OptionType, IsMulti, GroupType>,
          State<OptionType, IsMulti>
          > {}

            property defaultProps

            static defaultProps: DefaultProps;

              property onChange

              onChange: (
              value: ValueType<OptionType, IsMulti>,
              actionMeta: ActionMeta<OptionType>
              ) => void;

                property onInputChange

                onInputChange: (
                value: ValueType<OptionType, IsMulti>,
                actionMeta: InputActionMeta
                ) => void;

                  property onMenuClose

                  onMenuClose: () => void;

                    property onMenuOpen

                    onMenuOpen: () => void;

                      property select

                      select: SelectBase<OptionType, IsMulti, GroupTypeBase<OptionType>>;

                        method blur

                        blur: () => void;

                          method callProp

                          callProp: (name: string, ...args: any[]) => any;

                            method focus

                            focus: () => void;

                              method getProp

                              getProp: (key: string) => any;

                                Interfaces

                                interface ClearActionMeta

                                interface ClearActionMeta<OptionType extends OptionTypeBase> {}

                                  property action

                                  action: 'clear';

                                    property name

                                    name?: string;

                                      property removedValues

                                      removedValues: OptionType[];

                                        interface CommonProps

                                        interface CommonProps<
                                        OptionType extends OptionTypeBase,
                                        IsMulti extends boolean,
                                        GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                        > {}

                                          property className

                                          className?: string;

                                            property clearValue

                                            clearValue: () => void;

                                              property cx

                                              cx: (
                                              state: ClassNamesState | undefined,
                                              className: string | undefined
                                              ) => string;

                                                property getStyles

                                                getStyles: (name: string, props: any) => {};
                                                • Get the styles of a particular part of the select. Pass in the name of the property as the first argument, and the current props as the second argument. See the styles object for the properties available.

                                                property getValue

                                                getValue: () => OptionsType<OptionType>;

                                                  property hasValue

                                                  hasValue: boolean;
                                                  • Whether the value container currently holds a value.

                                                  property isMulti

                                                  isMulti: boolean;
                                                  • Set when the value container should hold multiple values

                                                  property isRtl

                                                  isRtl: boolean;
                                                  • Whether the text is right to left

                                                  property options

                                                  options: OptionsType<OptionType>;

                                                    property selectOption

                                                    selectOption: (option: OptionType) => void;

                                                      property selectProps

                                                      selectProps: SelectProps<OptionType, IsMulti, GroupType>;

                                                        property setValue

                                                        setValue: (
                                                        newValue: ValueType<OptionType, IsMulti>,
                                                        action: SetValueAction,
                                                        option?: OptionType
                                                        ) => void;

                                                          property theme

                                                          theme: Theme;

                                                            interface CreateOptionActionMeta

                                                            interface CreateOptionActionMeta {}

                                                              property action

                                                              action: 'create-option';

                                                                property name

                                                                name?: string;

                                                                  interface DeselectOptionActionMeta

                                                                  interface DeselectOptionActionMeta<OptionType extends OptionTypeBase> {}

                                                                    property action

                                                                    action: 'deselect-option';

                                                                      property name

                                                                      name?: string;

                                                                        property option

                                                                        option: OptionType | undefined;

                                                                          interface FormatOptionLabelMeta

                                                                          interface FormatOptionLabelMeta<
                                                                          OptionType extends OptionTypeBase,
                                                                          IsMulti extends boolean
                                                                          > {}

                                                                            property context

                                                                            context: FormatOptionLabelContext;

                                                                              property inputValue

                                                                              inputValue: string;

                                                                                property selectValue

                                                                                selectValue: ValueType<OptionType, IsMulti>;

                                                                                  interface GroupTypeBase

                                                                                  interface GroupTypeBase<OptionType extends OptionTypeBase> {}

                                                                                    property options

                                                                                    options: OptionsType<OptionType>;

                                                                                      index signature

                                                                                      [key: string]: any;

                                                                                        interface InputActionMeta

                                                                                        interface InputActionMeta {}

                                                                                          property action

                                                                                          action: InputActionTypes;

                                                                                            interface InputProps

                                                                                            interface InputProps {}

                                                                                              property autoComplete

                                                                                              autoComplete?: string;
                                                                                              • Autocomplete value for the Select Input

                                                                                              property className

                                                                                              className?: string;

                                                                                                property cx

                                                                                                cx: (a: string | null, b: ClassNamesState, c: string) => string | void;

                                                                                                  property getStyles

                                                                                                  getStyles: (name: string, props: any) => {};

                                                                                                    property innerRef

                                                                                                    innerRef: (element: ElementRef<any>) => void;
                                                                                                    • Reference to the internal element

                                                                                                    property isDisabled

                                                                                                    isDisabled?: boolean;
                                                                                                    • Whether the input is disabled

                                                                                                    property isHidden

                                                                                                    isHidden: boolean;
                                                                                                    • Set whether the input should be visible. Does not affect input size.

                                                                                                    property theme

                                                                                                    theme: Theme;

                                                                                                      interface NamedProps

                                                                                                      interface NamedProps<
                                                                                                      OptionType extends OptionTypeBase = { label: string; value: string },
                                                                                                      IsMulti extends boolean = false,
                                                                                                      GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                      > {}

                                                                                                        property 'aria-label'

                                                                                                        'aria-label'?: string;
                                                                                                        • Aria label (for assistive tech)

                                                                                                        property 'aria-labelledby'

                                                                                                        'aria-labelledby'?: string;
                                                                                                        • HTML ID of an element that should be used as the label (for assistive tech)

                                                                                                        property autoFocus

                                                                                                        autoFocus?: boolean;
                                                                                                        • Focus the control when it is mounted

                                                                                                        property backspaceRemovesValue

                                                                                                        backspaceRemovesValue?: boolean;
                                                                                                        • Remove the currently focused option when the user presses backspace

                                                                                                        property blurInputOnSelect

                                                                                                        blurInputOnSelect?: boolean;
                                                                                                        • Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices)

                                                                                                        property captureMenuScroll

                                                                                                        captureMenuScroll?: boolean;
                                                                                                        • When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent

                                                                                                        property className

                                                                                                        className?: string;
                                                                                                        • className attribute applied to the outer component

                                                                                                        property classNamePrefix

                                                                                                        classNamePrefix?: string | null;
                                                                                                        • classNamePrefix attribute used as a base for inner component classNames

                                                                                                        property closeMenuOnScroll

                                                                                                        closeMenuOnScroll?: boolean | EventListener;
                                                                                                        • If true, close the select menu when the user scrolls the document/body.

                                                                                                          If a function, takes a standard javascript ScrollEvent you return a boolean:

                                                                                                          true => The menu closes

                                                                                                          false => The menu stays open

                                                                                                          This is useful when you have a scrollable modal and want to portal the menu out, but want to avoid graphical issues.

                                                                                                        property closeMenuOnSelect

                                                                                                        closeMenuOnSelect?: boolean;
                                                                                                        • Close the select menu when the user selects an option

                                                                                                        property components

                                                                                                        components?: SelectComponentsConfig<OptionType, IsMulti, GroupType>;
                                                                                                        • This complex object includes all the compositional components that are used in react-select. If you wish to overwrite a component, pass in an object with the appropriate namespace.

                                                                                                          If you only wish to restyle a component, we recommend using the styles prop instead. For a list of the components that can be passed in, and the shape that will be passed to them, see [the components docs](/api#components)

                                                                                                        property controlShouldRenderValue

                                                                                                        controlShouldRenderValue?: boolean;
                                                                                                        • Whether the value of the select, e.g. SingleValue, should be displayed in the control.

                                                                                                        property defaultInputValue

                                                                                                        defaultInputValue?: string;

                                                                                                          property defaultMenuIsOpen

                                                                                                          defaultMenuIsOpen?: boolean;

                                                                                                            property defaultValue

                                                                                                            defaultValue?: readonly OptionType[] | OptionType | null;

                                                                                                              property delimiter

                                                                                                              delimiter?: string;
                                                                                                              • Delimiter used to join multiple values into a single HTML Input value

                                                                                                              property escapeClearsValue

                                                                                                              escapeClearsValue?: boolean;
                                                                                                              • Clear all values when the user presses escape AND the menu is closed

                                                                                                              property filterOption

                                                                                                              filterOption?: ((option: Option, rawInput: string) => boolean) | null;
                                                                                                              • Custom method to filter whether an option should be displayed in the menu

                                                                                                              property formatGroupLabel

                                                                                                              formatGroupLabel?: formatGroupLabel<OptionType, GroupType>;
                                                                                                              • Formats group labels in the menu as React components

                                                                                                              property formatOptionLabel

                                                                                                              formatOptionLabel?: (
                                                                                                              option: OptionType,
                                                                                                              labelMeta: FormatOptionLabelMeta<OptionType, IsMulti>
                                                                                                              ) => React.ReactNode;
                                                                                                              • Formats option labels in the menu and control as React components

                                                                                                              property getOptionLabel

                                                                                                              getOptionLabel?: getOptionLabel<OptionType>;
                                                                                                              • Resolves option data to a string to be displayed as the label by components

                                                                                                              property getOptionValue

                                                                                                              getOptionValue?: getOptionValue<OptionType>;
                                                                                                              • Resolves option data to a string to compare options and specify value attributes

                                                                                                              property hideSelectedOptions

                                                                                                              hideSelectedOptions?: boolean;
                                                                                                              • Hide the selected option from the menu

                                                                                                              property id

                                                                                                              id?: string;
                                                                                                              • The id to set on the SelectContainer component.

                                                                                                              property inputId

                                                                                                              inputId?: string;
                                                                                                              • The id of the search input

                                                                                                              property inputValue

                                                                                                              inputValue?: string;
                                                                                                              • The value of the search input

                                                                                                              property instanceId

                                                                                                              instanceId?: number | string;
                                                                                                              • Define an id prefix for the select components e.g. {your-id}-value

                                                                                                              property isClearable

                                                                                                              isClearable?: boolean;
                                                                                                              • Is the select value clearable

                                                                                                              property isDisabled

                                                                                                              isDisabled?: boolean;
                                                                                                              • Is the select disabled

                                                                                                              property isLoading

                                                                                                              isLoading?: boolean;
                                                                                                              • Is the select in a state of loading (async)

                                                                                                              property isMulti

                                                                                                              isMulti?: IsMulti;
                                                                                                              • Support multiple selected options

                                                                                                              property isOptionDisabled

                                                                                                              isOptionDisabled?: (
                                                                                                              option: OptionType,
                                                                                                              options: OptionsType<OptionType>
                                                                                                              ) => boolean | false;
                                                                                                              • Override the built-in logic to detect whether an option is disabled

                                                                                                              property isOptionSelected

                                                                                                              isOptionSelected?: (
                                                                                                              option: OptionType,
                                                                                                              options: OptionsType<OptionType>
                                                                                                              ) => boolean;
                                                                                                              • Override the built-in logic to detect whether an option is selected

                                                                                                              property isRtl

                                                                                                              isRtl?: boolean;
                                                                                                              • Is the select direction right-to-left

                                                                                                              property isSearchable

                                                                                                              isSearchable?: boolean;
                                                                                                              • Whether to enable search functionality

                                                                                                              property loadingMessage

                                                                                                              loadingMessage?: (obj: { inputValue: string }) => string | null;
                                                                                                              • Async: Text to display when loading options

                                                                                                              property maxMenuHeight

                                                                                                              maxMenuHeight?: number;
                                                                                                              • Maximum height of the menu before scrolling

                                                                                                              property menuIsOpen

                                                                                                              menuIsOpen?: boolean;
                                                                                                              • Whether the menu is open

                                                                                                              property menuPlacement

                                                                                                              menuPlacement?: MenuPlacement;
                                                                                                              • Default placement of the menu in relation to the control. 'auto' will flip when there isn't enough space below the control.

                                                                                                              property menuPortalTarget

                                                                                                              menuPortalTarget?: HTMLElement | null;
                                                                                                              • Whether the menu should use a portal, and where it should attach

                                                                                                              property menuPosition

                                                                                                              menuPosition?: MenuPosition;
                                                                                                              • The CSS position value of the menu, when "fixed" extra layout management is required

                                                                                                              property menuShouldBlockScroll

                                                                                                              menuShouldBlockScroll?: boolean;
                                                                                                              • Whether to block scroll events when the menu is open

                                                                                                              property menuShouldScrollIntoView

                                                                                                              menuShouldScrollIntoView?: boolean;
                                                                                                              • Whether the menu should be scrolled into view when it opens

                                                                                                              property minMenuHeight

                                                                                                              minMenuHeight?: number;
                                                                                                              • Minimum height of the menu before flipping

                                                                                                              property name

                                                                                                              name?: string;
                                                                                                              • Name of the HTML Input (optional - without this, no input will be rendered)

                                                                                                              property noOptionsMessage

                                                                                                              noOptionsMessage?: (obj: { inputValue: string }) => string | null;
                                                                                                              • Text to display when there are no options

                                                                                                              property onBlur

                                                                                                              onBlur?: FocusEventHandler;
                                                                                                              • Handle blur events on the control

                                                                                                              property onChange

                                                                                                              onChange?: (
                                                                                                              value: ValueType<OptionType, IsMulti>,
                                                                                                              action: ActionMeta<OptionType>
                                                                                                              ) => void;
                                                                                                              • Handle change events on the select

                                                                                                              property onFocus

                                                                                                              onFocus?: FocusEventHandler;
                                                                                                              • Handle focus events on the control

                                                                                                              property onInputChange

                                                                                                              onInputChange?: (newValue: string, actionMeta: InputActionMeta) => void;
                                                                                                              • Handle change events on the input

                                                                                                              property onKeyDown

                                                                                                              onKeyDown?: KeyboardEventHandler;
                                                                                                              • Handle key down events on the select

                                                                                                              property onMenuClose

                                                                                                              onMenuClose?: () => void;
                                                                                                              • Handle the menu closing

                                                                                                              property onMenuOpen

                                                                                                              onMenuOpen?: () => void;
                                                                                                              • Handle the menu opening

                                                                                                              property onMenuScrollToBottom

                                                                                                              onMenuScrollToBottom?: (event: React.SyntheticEvent<HTMLElement>) => void;
                                                                                                              • Fired when the user scrolls to the bottom of the menu

                                                                                                              property onMenuScrollToTop

                                                                                                              onMenuScrollToTop?: (event: React.SyntheticEvent<HTMLElement>) => void;
                                                                                                              • Fired when the user scrolls to the top of the menu

                                                                                                              property openMenuOnClick

                                                                                                              openMenuOnClick?: boolean;
                                                                                                              • Allows control of whether the menu is opened when the Select is clicked

                                                                                                              property openMenuOnFocus

                                                                                                              openMenuOnFocus?: boolean;
                                                                                                              • Allows control of whether the menu is opened when the Select is focused

                                                                                                              property options

                                                                                                              options?: ReadonlyArray<OptionType | GroupType>;
                                                                                                              • Array of options that populate the select menu

                                                                                                              property pageSize

                                                                                                              pageSize?: number;
                                                                                                              • Number of options to jump in menu when page{up|down} keys are used

                                                                                                              property placeholder

                                                                                                              placeholder?: React.ReactNode;
                                                                                                              • Placeholder text for the select value

                                                                                                              property screenReaderStatus

                                                                                                              screenReaderStatus?: (obj: { count: number }) => string;
                                                                                                              • Status to relay to screen readers

                                                                                                              property styles

                                                                                                              styles?: StylesConfig<OptionType, IsMulti, GroupType>;
                                                                                                              • Style modifier methods

                                                                                                              property tabIndex

                                                                                                              tabIndex?: string | null;
                                                                                                              • Sets the tabIndex attribute on the input

                                                                                                              property tabSelectsValue

                                                                                                              tabSelectsValue?: boolean;
                                                                                                              • Select the currently focused option when the user presses tab

                                                                                                              property theme

                                                                                                              theme?: ThemeConfig;
                                                                                                              • Theme modifier method

                                                                                                              property value

                                                                                                              value?: readonly OptionType[] | OptionType | null;
                                                                                                              • The value of the select; reflected by the selected option

                                                                                                              interface OptionTypeBase

                                                                                                              interface OptionTypeBase {}

                                                                                                                index signature

                                                                                                                [key: string]: any;

                                                                                                                  interface PlaceholderProps

                                                                                                                  interface PlaceholderProps<
                                                                                                                  OptionType extends OptionTypeBase,
                                                                                                                  IsMulti extends boolean,
                                                                                                                  GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                  > extends CommonProps<OptionType, IsMulti, GroupType> {}

                                                                                                                    property children

                                                                                                                    children: ReactNode;
                                                                                                                    • The children to be rendered.

                                                                                                                    property className

                                                                                                                    className?: string;

                                                                                                                      property innerProps

                                                                                                                      innerProps: { style: CSSProperties };

                                                                                                                        property isDisabled

                                                                                                                        isDisabled: boolean;

                                                                                                                          property isFocused

                                                                                                                          isFocused: boolean;

                                                                                                                            interface PopValueActionMeta

                                                                                                                            interface PopValueActionMeta<OptionType extends OptionTypeBase> {}

                                                                                                                              property action

                                                                                                                              action: 'pop-value';

                                                                                                                                property name

                                                                                                                                name?: string;

                                                                                                                                  property removedValue

                                                                                                                                  removedValue: OptionType;

                                                                                                                                    interface Props

                                                                                                                                    interface Props<
                                                                                                                                    OptionType extends OptionTypeBase = { label: string; value: string },
                                                                                                                                    IsMulti extends boolean = false,
                                                                                                                                    GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                    > extends NamedProps<OptionType, IsMulti, GroupType>,
                                                                                                                                    SelectComponentsProps {}

                                                                                                                                      interface PropsWithInnerRef

                                                                                                                                      interface PropsWithInnerRef {}

                                                                                                                                        property innerRef

                                                                                                                                        innerRef: React.Ref<any>;
                                                                                                                                        • The inner reference.

                                                                                                                                        interface RemoveValueActionMeta

                                                                                                                                        interface RemoveValueActionMeta<OptionType extends OptionTypeBase> {}

                                                                                                                                          property action

                                                                                                                                          action: 'remove-value';

                                                                                                                                            property name

                                                                                                                                            name?: string;

                                                                                                                                              property removedValue

                                                                                                                                              removedValue: OptionType;

                                                                                                                                                interface SelectOptionActionMeta

                                                                                                                                                interface SelectOptionActionMeta<OptionType extends OptionTypeBase> {}

                                                                                                                                                  property action

                                                                                                                                                  action: 'select-option';

                                                                                                                                                    property name

                                                                                                                                                    name?: string;

                                                                                                                                                      property option

                                                                                                                                                      option: OptionType | undefined;

                                                                                                                                                        interface Styles

                                                                                                                                                        interface Styles<
                                                                                                                                                        OptionType extends OptionTypeBase,
                                                                                                                                                        IsMulti extends boolean,
                                                                                                                                                        GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                        > {}

                                                                                                                                                          property input

                                                                                                                                                          input?: (base: CSSObject, props: InputProps) => CSSObject;

                                                                                                                                                            method clearIndicator

                                                                                                                                                            clearIndicator: (
                                                                                                                                                            base: any,
                                                                                                                                                            props: IndicatorProps<OptionType, IsMulti, GroupType>
                                                                                                                                                            ) => any;

                                                                                                                                                              method container

                                                                                                                                                              container: (
                                                                                                                                                              base: any,
                                                                                                                                                              props: ContainerProps<OptionType, IsMulti, GroupType>
                                                                                                                                                              ) => any;

                                                                                                                                                                method control

                                                                                                                                                                control: (base: any, props: ControlProps<OptionType, IsMulti, GroupType>) => any;

                                                                                                                                                                  method dropdownIndicator

                                                                                                                                                                  dropdownIndicator: (
                                                                                                                                                                  base: any,
                                                                                                                                                                  props: IndicatorProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                  ) => any;

                                                                                                                                                                    method group

                                                                                                                                                                    group: (base: any, props: GroupProps<OptionType, IsMulti, GroupType>) => any;

                                                                                                                                                                      method groupHeading

                                                                                                                                                                      groupHeading: (
                                                                                                                                                                      base: any,
                                                                                                                                                                      props: GroupHeadingProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                      ) => any;

                                                                                                                                                                        method indicatorsContainer

                                                                                                                                                                        indicatorsContainer: (
                                                                                                                                                                        base: any,
                                                                                                                                                                        props: IndicatorContainerProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                        ) => any;

                                                                                                                                                                          method indicatorSeparator

                                                                                                                                                                          indicatorSeparator: (
                                                                                                                                                                          base: any,
                                                                                                                                                                          props: IndicatorProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                          ) => any;

                                                                                                                                                                            method loadingIndicator

                                                                                                                                                                            loadingIndicator: (
                                                                                                                                                                            base: any,
                                                                                                                                                                            props: LoadingIndicatorProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                            ) => any;

                                                                                                                                                                              method loadingMessage

                                                                                                                                                                              loadingMessage: (
                                                                                                                                                                              base: any,
                                                                                                                                                                              props: NoticeProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                              ) => any;

                                                                                                                                                                                method menu

                                                                                                                                                                                menu: (base: any, props: MenuProps<OptionType, IsMulti, GroupType>) => any;

                                                                                                                                                                                  method menuList

                                                                                                                                                                                  menuList: (
                                                                                                                                                                                  base: any,
                                                                                                                                                                                  props: MenuListComponentProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                                  ) => any;

                                                                                                                                                                                    method menuPortal

                                                                                                                                                                                    menuPortal: (
                                                                                                                                                                                    base: any,
                                                                                                                                                                                    props: MenuPortalProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                                    ) => any;

                                                                                                                                                                                      method multiValue

                                                                                                                                                                                      multiValue: (base: any, props: MultiValueProps<OptionType, GroupType>) => any;

                                                                                                                                                                                        method multiValueLabel

                                                                                                                                                                                        multiValueLabel: (
                                                                                                                                                                                        base: any,
                                                                                                                                                                                        props: MultiValueProps<OptionType, GroupType>
                                                                                                                                                                                        ) => any;

                                                                                                                                                                                          method multiValueRemove

                                                                                                                                                                                          multiValueRemove: (
                                                                                                                                                                                          base: any,
                                                                                                                                                                                          props: MultiValueRemoveProps<OptionType, GroupType>
                                                                                                                                                                                          ) => any;

                                                                                                                                                                                            method noOptionsMessage

                                                                                                                                                                                            noOptionsMessage: (
                                                                                                                                                                                            base: any,
                                                                                                                                                                                            props: NoticeProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                                            ) => any;

                                                                                                                                                                                              method option

                                                                                                                                                                                              option: (base: any, props: OptionProps<OptionType, IsMulti, GroupType>) => any;

                                                                                                                                                                                                method placeholder

                                                                                                                                                                                                placeholder: (
                                                                                                                                                                                                base: any,
                                                                                                                                                                                                props: PlaceholderProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                                                ) => any;

                                                                                                                                                                                                  method singleValue

                                                                                                                                                                                                  singleValue: (base: any, props: SingleValueProps<OptionType, GroupType>) => any;

                                                                                                                                                                                                    method valueContainer

                                                                                                                                                                                                    valueContainer: (
                                                                                                                                                                                                    base: any,
                                                                                                                                                                                                    props: ValueContainerProps<OptionType, IsMulti, GroupType>
                                                                                                                                                                                                    ) => any;

                                                                                                                                                                                                      interface Theme

                                                                                                                                                                                                      interface Theme {}

                                                                                                                                                                                                        property borderRadius

                                                                                                                                                                                                        borderRadius: number;

                                                                                                                                                                                                          property colors

                                                                                                                                                                                                          colors: { [key: string]: string };

                                                                                                                                                                                                            property spacing

                                                                                                                                                                                                            spacing: ThemeSpacing;

                                                                                                                                                                                                              interface ThemeSpacing

                                                                                                                                                                                                              interface ThemeSpacing {}

                                                                                                                                                                                                                property baseUnit

                                                                                                                                                                                                                baseUnit: number;

                                                                                                                                                                                                                  property controlHeight

                                                                                                                                                                                                                  controlHeight: number;

                                                                                                                                                                                                                    property menuGutter

                                                                                                                                                                                                                    menuGutter: number;

                                                                                                                                                                                                                      Type Aliases

                                                                                                                                                                                                                      type Action

                                                                                                                                                                                                                      type Action = ActionMeta<OptionTypeBase>['action'];

                                                                                                                                                                                                                        type ActionMeta

                                                                                                                                                                                                                        type ActionMeta<OptionType extends OptionTypeBase> =
                                                                                                                                                                                                                        | SelectOptionActionMeta<OptionType>
                                                                                                                                                                                                                        | DeselectOptionActionMeta<OptionType>
                                                                                                                                                                                                                        | RemoveValueActionMeta<OptionType>
                                                                                                                                                                                                                        | PopValueActionMeta<OptionType>
                                                                                                                                                                                                                        | ClearActionMeta<OptionType>
                                                                                                                                                                                                                        | CreateOptionActionMeta;

                                                                                                                                                                                                                          type ClassNameList

                                                                                                                                                                                                                          type ClassNameList = string[];

                                                                                                                                                                                                                            type ClassNamesState

                                                                                                                                                                                                                            type ClassNamesState = { [key: string]: boolean } | undefined;

                                                                                                                                                                                                                              type ContainerProps

                                                                                                                                                                                                                              type ContainerProps<
                                                                                                                                                                                                                              OptionType extends OptionTypeBase,
                                                                                                                                                                                                                              IsMulti extends boolean,
                                                                                                                                                                                                                              GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                              > = CommonProps<OptionType, IsMulti, GroupType> &
                                                                                                                                                                                                                              ContainerState & {
                                                                                                                                                                                                                              /** The children to be rendered. */
                                                                                                                                                                                                                              children: ReactNode;
                                                                                                                                                                                                                              /** Inner props to be passed down to the container. */
                                                                                                                                                                                                                              innerProps: { onKeyDown: KeyboardEventHandler };
                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                type ControlProps

                                                                                                                                                                                                                                type ControlProps<
                                                                                                                                                                                                                                OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                IsMulti extends boolean,
                                                                                                                                                                                                                                GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                > = CommonProps<OptionType, IsMulti, GroupType> &
                                                                                                                                                                                                                                State & {
                                                                                                                                                                                                                                /** Children to render. */
                                                                                                                                                                                                                                children: ReactNode;
                                                                                                                                                                                                                                innerRef: ElementRef<any>;
                                                                                                                                                                                                                                /** The mouse down event and the innerRef to pass down to the controller element. */
                                                                                                                                                                                                                                innerProps: {
                                                                                                                                                                                                                                onMouseDown: (event: React.MouseEvent<HTMLElement>) => void;
                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                  type FocusDirection

                                                                                                                                                                                                                                  type FocusDirection = 'up' | 'down' | 'pageup' | 'pagedown' | 'first' | 'last';

                                                                                                                                                                                                                                    type FocusEventHandler

                                                                                                                                                                                                                                    type FocusEventHandler = (event: React.FocusEvent<HTMLElement>) => void;

                                                                                                                                                                                                                                      type GroupedOptionsType

                                                                                                                                                                                                                                      type GroupedOptionsType<
                                                                                                                                                                                                                                      OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                      GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                      > = ReadonlyArray<GroupType>;

                                                                                                                                                                                                                                        type GroupProps

                                                                                                                                                                                                                                        type GroupProps<
                                                                                                                                                                                                                                        OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                        IsMulti extends boolean,
                                                                                                                                                                                                                                        GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                        > = CommonProps<OptionType, IsMulti, GroupType> & ComponentProps;

                                                                                                                                                                                                                                          type IndicatorComponentType

                                                                                                                                                                                                                                          type IndicatorComponentType<
                                                                                                                                                                                                                                          OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                          IsMulti extends boolean,
                                                                                                                                                                                                                                          GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                          > = ComponentType<IndicatorProps<OptionType, IsMulti, GroupType>>;

                                                                                                                                                                                                                                            type IndicatorContainerProps

                                                                                                                                                                                                                                            type IndicatorContainerProps<
                                                                                                                                                                                                                                            OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                            IsMulti extends boolean,
                                                                                                                                                                                                                                            GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                            > = CommonProps<OptionType, IsMulti, GroupType> &
                                                                                                                                                                                                                                            IndicatorsState & {
                                                                                                                                                                                                                                            /** The children to be rendered. */
                                                                                                                                                                                                                                            children: ReactNode;
                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                              type IndicatorProps

                                                                                                                                                                                                                                              type IndicatorProps<
                                                                                                                                                                                                                                              OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                              IsMulti extends boolean,
                                                                                                                                                                                                                                              GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                              > = CommonProps<OptionType, IsMulti, GroupType> & {
                                                                                                                                                                                                                                              /** The children to be rendered inside the indicator. */
                                                                                                                                                                                                                                              children: ElementType;
                                                                                                                                                                                                                                              /** Props that will be passed on to the children. */
                                                                                                                                                                                                                                              innerProps: any;
                                                                                                                                                                                                                                              /** The focused state of the select. */
                                                                                                                                                                                                                                              isFocused: boolean;
                                                                                                                                                                                                                                              /** Whether the text is right to left */
                                                                                                                                                                                                                                              isRtl: boolean;
                                                                                                                                                                                                                                              /** Whether the component is disabled */
                                                                                                                                                                                                                                              isDisabled: boolean;
                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                type InnerRef

                                                                                                                                                                                                                                                type InnerRef = React.Ref<any>;

                                                                                                                                                                                                                                                  type InputActionTypes

                                                                                                                                                                                                                                                  type InputActionTypes = 'set-value' | 'input-change' | 'input-blur' | 'menu-close';

                                                                                                                                                                                                                                                    type KeyboardEventHandler

                                                                                                                                                                                                                                                    type KeyboardEventHandler = (event: React.KeyboardEvent<HTMLElement>) => void;
                                                                                                                                                                                                                                                      type MenuListComponentProps<
                                                                                                                                                                                                                                                      OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                      IsMulti extends boolean,
                                                                                                                                                                                                                                                      GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                      > = CommonProps<OptionType, IsMulti, GroupType> & MenuListProps & MenuListState;
                                                                                                                                                                                                                                                        type MenuPlacement = 'auto' | 'bottom' | 'top';
                                                                                                                                                                                                                                                          type MenuPosition = 'absolute' | 'fixed';
                                                                                                                                                                                                                                                            type MenuProps<
                                                                                                                                                                                                                                                            OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                            IsMulti extends boolean,
                                                                                                                                                                                                                                                            GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                            > = CommonProps<OptionType, IsMulti, GroupType> & {
                                                                                                                                                                                                                                                            /** The children to be rendered. */
                                                                                                                                                                                                                                                            children: ReactElement;
                                                                                                                                                                                                                                                            /** Callback to update the portal after possible flip. */
                                                                                                                                                                                                                                                            getPortalPlacement: (state: MenuState) => void;
                                                                                                                                                                                                                                                            /** Props to be passed to the menu wrapper. */
                                                                                                                                                                                                                                                            innerProps: object;
                                                                                                                                                                                                                                                            /** Reference to the internal element, consumed by the MenuPlacer component */
                                                                                                                                                                                                                                                            innerRef: InnerRef;
                                                                                                                                                                                                                                                            /** Set the maximum height of the menu. */
                                                                                                                                                                                                                                                            maxMenuHeight: number;
                                                                                                                                                                                                                                                            /** Set whether the menu should be at the top, at the bottom. The auto options sets it to bottom. */
                                                                                                                                                                                                                                                            menuPlacement: MenuPlacement;
                                                                                                                                                                                                                                                            /* The CSS position value of the menu, when "fixed" extra layout management is required */
                                                                                                                                                                                                                                                            menuPosition: MenuPosition;
                                                                                                                                                                                                                                                            /** Set the minimum height of the menu. */
                                                                                                                                                                                                                                                            minMenuHeight: number;
                                                                                                                                                                                                                                                            /** Set whether the page should scroll to show the menu. */
                                                                                                                                                                                                                                                            menuShouldScrollIntoView: boolean;
                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                              type MouseEventHandler

                                                                                                                                                                                                                                                              type MouseEventHandler = (event: React.MouseEvent<HTMLElement>) => void;

                                                                                                                                                                                                                                                                type MultiValueProps

                                                                                                                                                                                                                                                                type MultiValueProps<
                                                                                                                                                                                                                                                                OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                                > = CommonProps<OptionType, true, GroupType> & {
                                                                                                                                                                                                                                                                children: ReactNode;
                                                                                                                                                                                                                                                                components: any;
                                                                                                                                                                                                                                                                cropWithEllipsis: boolean;
                                                                                                                                                                                                                                                                data: OptionType;
                                                                                                                                                                                                                                                                innerProps: any;
                                                                                                                                                                                                                                                                isFocused: boolean;
                                                                                                                                                                                                                                                                isDisabled: boolean;
                                                                                                                                                                                                                                                                removeProps: {
                                                                                                                                                                                                                                                                onTouchEnd: (event: any) => void;
                                                                                                                                                                                                                                                                onClick: (event: any) => void;
                                                                                                                                                                                                                                                                onMouseDown: (event: any) => void;
                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                  type OptionProps

                                                                                                                                                                                                                                                                  type OptionProps<
                                                                                                                                                                                                                                                                  OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                  IsMulti extends boolean,
                                                                                                                                                                                                                                                                  GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                                  > = CommonProps<OptionType, IsMulti, GroupType> &
                                                                                                                                                                                                                                                                  State & {
                                                                                                                                                                                                                                                                  /** The children to be rendered. */
                                                                                                                                                                                                                                                                  children: ReactNode;
                                                                                                                                                                                                                                                                  /** Inner ref to DOM Node */
                                                                                                                                                                                                                                                                  innerRef: InnerRef;
                                                                                                                                                                                                                                                                  /** props passed to the wrapping element for the group. */
                                                                                                                                                                                                                                                                  innerProps: InnerProps;
                                                                                                                                                                                                                                                                  /* Text to be displayed representing the option. */
                                                                                                                                                                                                                                                                  label: string;
                                                                                                                                                                                                                                                                  /* Type is used by the menu to determine whether this is an option or a group.
                                                                                                                                                                                                                                                                  In the case of option this is always `option`. */
                                                                                                                                                                                                                                                                  type: 'option';
                                                                                                                                                                                                                                                                  /* The data of the selected option. */
                                                                                                                                                                                                                                                                  data: any;
                                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                                    type OptionsType

                                                                                                                                                                                                                                                                    type OptionsType<OptionType extends OptionTypeBase> = ReadonlyArray<OptionType>;

                                                                                                                                                                                                                                                                      type SelectComponentsConfig

                                                                                                                                                                                                                                                                      type SelectComponentsConfig<
                                                                                                                                                                                                                                                                      OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                      IsMulti extends boolean,
                                                                                                                                                                                                                                                                      GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                                      > = Partial<SelectComponents<OptionType, IsMulti, GroupType>>;

                                                                                                                                                                                                                                                                        type SetValueAction

                                                                                                                                                                                                                                                                        type SetValueAction = 'select-option' | 'deselect-option';

                                                                                                                                                                                                                                                                          type SingleValueProps

                                                                                                                                                                                                                                                                          type SingleValueProps<
                                                                                                                                                                                                                                                                          OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                          GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                                          > = CommonProps<OptionType, false, GroupType> & ValueProps<OptionType> & State;

                                                                                                                                                                                                                                                                            type StylesConfig

                                                                                                                                                                                                                                                                            type StylesConfig<
                                                                                                                                                                                                                                                                            OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                            IsMulti extends boolean,
                                                                                                                                                                                                                                                                            GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                                            > = Partial<Styles<OptionType, IsMulti, GroupType>>;

                                                                                                                                                                                                                                                                              type ValueContainerProps

                                                                                                                                                                                                                                                                              type ValueContainerProps<
                                                                                                                                                                                                                                                                              OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                              IsMulti extends boolean,
                                                                                                                                                                                                                                                                              GroupType extends GroupTypeBase<OptionType> = GroupTypeBase<OptionType>
                                                                                                                                                                                                                                                                              > = CommonProps<OptionType, IsMulti, GroupType> & {
                                                                                                                                                                                                                                                                              /** Set when the value container should hold multiple values */
                                                                                                                                                                                                                                                                              isMulti: boolean;
                                                                                                                                                                                                                                                                              /** Whether the value container currently holds a value. */
                                                                                                                                                                                                                                                                              hasValue: boolean;
                                                                                                                                                                                                                                                                              /** The children to be rendered. */
                                                                                                                                                                                                                                                                              children: ReactNode;
                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                type ValueType

                                                                                                                                                                                                                                                                                type ValueType<
                                                                                                                                                                                                                                                                                OptionType extends OptionTypeBase,
                                                                                                                                                                                                                                                                                IsMulti extends boolean
                                                                                                                                                                                                                                                                                > = IsMulti extends true ? OptionsType<OptionType> : OptionType | null;

                                                                                                                                                                                                                                                                                  Package Files (19)

                                                                                                                                                                                                                                                                                  Dependencies (4)

                                                                                                                                                                                                                                                                                  Dev Dependencies (0)

                                                                                                                                                                                                                                                                                  No dev dependencies.

                                                                                                                                                                                                                                                                                  Peer Dependencies (0)

                                                                                                                                                                                                                                                                                  No peer dependencies.

                                                                                                                                                                                                                                                                                  Badge

                                                                                                                                                                                                                                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/react-select.

                                                                                                                                                                                                                                                                                  • Markdown
                                                                                                                                                                                                                                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/react-select)
                                                                                                                                                                                                                                                                                  • HTML
                                                                                                                                                                                                                                                                                    <a href="https://www.jsdocs.io/package/@types/react-select"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>