Dropdown Menu
Installation
- yarn
- pnpm
- npm
yarn add @mercell/dropdown-react
pnpm add @mercell/dropdown-react
npm install --save @mercell/dropdown-react
The Dropdown has necessary peerDependencies, please make sure that you have them in your project
"@carbon/icons-react": "^10.49.0",
"@mercell/checkbox-react": "^5.0.1",
"@mercell/tailwind": "^6.0.1",
"@mercell/use-window-resize-react-hook": "^0.0.6",
"classnames": "^2.3.1",
"react": "^17.0.2"
Usage
Dropdown component is based on common react library called React-Select. All props which are possible inside React-Select can be applied inside <Dropdown/>
component.
We strongly recommend to take a look at React-Select documentation.
It supports virtualization for 100+ elements inside the list and also multiselect case if user will need to select more than one thing from the list.
import { Dropdown } from '@mercell/dropdown-react';
Types, definitions, etc.
- Types
- Changelog
- Figma
DropdownProps
interface DropdownMenuProps {
invalid?: boolean;
sizeToEnterVirtualization?: number;
innerPropsOfValueTag?: JSX.IntrinsicElements['div'] & Record<string, string>;
} & Omit<StateManagerProps, 'components'>
Name | Type | Default | Required | Description |
---|---|---|---|---|
invalid | boolean | - | no | Changing style to indicate error inside dropdown |
sizeToEnterVirtualization | number | 100 | no | Number where dropdown start virtualization instead of normal render for better performance |
innerPropsOfValueTag | JSX.IntrinsicElements['div'] & Record<string, string> | - | no | Possibility to pass Div properties to the value tag in selected dropdown state |
Rest of the React-Select props | StateManagerProps | - | no | All possible properties based on the React-Select documentation, e.g. isMulti, isClearable, hideSelectedOptions, options etc. |
Change Log - @mercell/dropdown-react
This log was last generated on Tue, 31 Jan 2023 11:47:28 GMT and should not be manually modified.
2.0.3
Tue, 31 Jan 2023 11:47:28 GMT
Patches
- Add possibility to pass inner props to SingleValue and MultiValueLabel components to support testing datasets
2.0.2
Fri, 16 Dec 2022 12:59:24 GMT
Patches
- Change openOnFocus prop default value
2.0.1
Fri, 25 Nov 2022 08:14:58 GMT
Patches
- Fix disabled status in chevron
2.0.0
Fri, 11 Nov 2022 09:18:57 GMT
Breaking changes
- New styling approach - use only tailwind classes, add tailwind-merge library
1.0.2
Tue, 25 Oct 2022 10:31:44 GMT
Patches
- Updated selected background color to match design system selected color
1.0.1
Mon, 24 Oct 2022 13:47:56 GMT
Patches
- Fix styling to not overwrite initial styles with prefixed in MF projects
1.0.0
Thu, 15 Sep 2022 06:07:41 GMT
Breaking changes
- Migration to Tailwind3, React 18 and ViteJS from webpack.
0.1.5
Thu, 28 Jul 2022 07:07:07 GMT
Patches
- Add custom multiselect disabled option, fix name problem for input
0.1.4
Thu, 21 Jul 2022 13:05:01 GMT
Patches
- Set focus action to open dropdown by default
0.1.3
Thu, 14 Jul 2022 13:28:46 GMT
Patches
- Updated hover state to remove sticky hover on mobile
0.1.2
Mon, 11 Jul 2022 12:29:41 GMT
Patches
- Fix - dropdown search with virtualization when no match was found
0.1.1
Thu, 30 Jun 2022 10:57:49 GMT
Patches
- Fix typings
- Package.json refactor, add test suite, more tests soon
0.1.0
Thu, 02 Jun 2022 10:46:30 GMT
Minor changes
- New multiselect look, fix truncation issue
0.0.12
Wed, 30 Mar 2022 10:15:45 GMT
Patches
- Styling fix
0.0.11
Wed, 09 Mar 2022 10:29:16 GMT
Patches
- Change of selected color
0.0.10
Mon, 28 Feb 2022 12:45:49 GMT
Patches
- Dependency update
0.0.9
Mon, 28 Feb 2022 10:55:32 GMT
Patches
- Bump typescript
0.0.8
Thu, 03 Feb 2022 11:30:43 GMT
Patches
- Change way of getting className for list member
0.0.7
Tue, 01 Feb 2022 15:47:46 GMT
Patches
- Fix circular issue with JSON memoization
0.0.6
Tue, 01 Feb 2022 14:56:30 GMT
Patches
- Add memo to component
0.0.5
Tue, 01 Feb 2022 13:00:55 GMT
Patches
- Fix for the virtualized list
0.0.4
Thu, 27 Jan 2022 09:31:12 GMT
Patches
- Fix styles - height, fix default props
0.0.3
Wed, 26 Jan 2022 16:19:19 GMT
Patches
- Move dependencies to peerDependencies to avoid duplication in installation process in project
- Adding the same peerDependencies to devDependencies
0.0.2
Fri, 21 Jan 2022 13:08:25 GMT
Patches
- New component based on React-Select library
Sometimes it can take some time until Figma will render component inside embed iframe. Try to click plus icon to 'reset' initial loader. (Works only in Chrome)
Click me to open figma in the new card