bb-plane-fork/packages/ui/src/dropdown
sriram veeraghanta 02d0ee3e0f
chore: add copyright (#8584)
* feat: adding new copyright info on all files

* chore: adding CI
2026-01-27 13:54:22 +05:30
..
common chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
dropdown.d.ts [WEB-5416] fix: Use proper import syntax (#8105) 2025-11-13 17:41:06 +05:30
index.ts chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
multi-select.tsx chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
Readme.md chore: format files using prettier (#7364) 2025-07-08 20:41:11 +05:30
single-select.tsx chore: add copyright (#8584) 2026-01-27 13:54:22 +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.