bb-plane-fork/packages/ui/src/dropdown
Aaron 553f01fde1
feat: migrate to pnpm from yarn (#7593)
* chore(repo): migrate to pnpm

* chore(repo): cleanup pnpm integration with turbo

* chore(repo): run lint

* chore(repo): cleanup tsconfigs

* chore: align TypeScript to 5.8.3 across monorepo; update pnpm override and catalog; pnpm install to update lockfile

* chore(repo): revert logger.ts changes

* fix: type errors

* fix: build errors

* fix: pnpm home setup in dockerfiles

---------

Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
2025-08-19 20:06:42 +05:30
..
common [WEB-4661] fix: move helpers file into utils #7568 2025-08-11 18:42:51 +05:30
dropdown.d.ts [WEB-4154] fix: dropdown container classname (#7085) 2025-05-23 13:53:16 +05:30
index.ts [WEB-1201] dev: dropdowns (#4721) 2024-06-07 13:59:31 +05:30
multi-select.tsx feat: migrate to pnpm from yarn (#7593) 2025-08-19 20:06:42 +05:30
Readme.md chore: format files using prettier (#7364) 2025-07-08 20:41:11 +05:30
single-select.tsx feat: migrate to pnpm from yarn (#7593) 2025-08-19 20:06:42 +05:30

Below is a detailed list of the props included:

Root Props

  • value: string | string[]; - Current selected value.
  • onChange: (value: string | string []) => void; - Callback function for handling value changes.
  • options: TDropdownOption[] | undefined; - Array of options.
  • onOpen?: () => void; - Callback function triggered when the dropdown opens.
  • onClose?: () => void; - Callback function triggered when the dropdown closes.
  • containerClassName?: (isOpen: boolean) => string; - Function to return the class name for the container based on the open state.
  • tabIndex?: number; - Sets the tab index for the dropdown.
  • placement?: Placement; - Determines the placement of the dropdown (e.g., top, bottom, left, right).
  • disabled?: boolean; - Disables the dropdown if set to true.

Button Props

  • buttonContent?: (isOpen: boolean) => React.ReactNode; - Function to render the content of the button based on the open state.
  • buttonContainerClassName?: string; - Class name for the button container.
  • buttonClassName?: string; - Class name for the button itself.

Input Props

  • disableSearch?: boolean; - Disables the search input if set to true.
  • inputPlaceholder?: string; - Placeholder text for the search input.
  • inputClassName?: string; - Class name for the search input.
  • inputIcon?: React.ReactNode; - Icon to be displayed in the search input.
  • inputContainerClassName?: string; - Class name for the search input container.

Options Props

  • keyExtractor: (option: TDropdownOption) => string; - Function to extract the key from each option.
  • optionsContainerClassName?: string; - Class name for the options container.
  • queryArray: string[]; - Array of strings to be used for querying the options.
  • sortByKey: string; - Key to sort the options by.
  • firstItem?: (optionValue: string) => boolean; - Function to determine if an option should be the first item.
  • renderItem?: ({ value, selected }: { value: string; selected: boolean }) => React.ReactNode; - Function to render each option.
  • loader?: React.ReactNode; - Loader element to be displayed while options are being loaded.
  • disableSorting?: boolean; - Disables sorting of the options if set to true.

These properties offer extensive control over the dropdown's behavior and presentation, making it a highly versatile component suitable for various scenarios.