Skip to content

Custom Month and Year dropdown using react-select #1512

Answered by gpbl
brendonco asked this question in Support
Discussion options

You must be logged in to vote

@brendonco never tried it with react-select, but you can try implementing your own dropdown component using it, and pass it to the components prop:

import { DropdownProps } from 'react-day-picker';
function CustomDropDown(props: DropdownProps) {
  return <ReactSelect/>
}
export function CustomDayPicker() {
  return (
    <DayPicker
       components={{
         Dropdown: CustomDropDown
       }}
    />;
  );
}

https://react-day-picker.js.org/guides/custom-components
https://react-day-picker.js.org/api/interfaces/CustomComponents#dropdown

Let us know how far you go!

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@brendonco
Comment options

@gpbl
Comment options

@brendonco
Comment options

@gpbl
Comment options

@brendonco
Comment options

Answer selected by brendonco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants