@@ -56,24 +56,26 @@ export default Example;
5656
5757## 👀 Props
5858
59- | Prop | Description | Type | Default |
60- | --------------------- | ----------------------------------- | ---------------------------- | -------------- |
61- | ` labelledBy ` | value for ` aria-labelledby ` | ` string ` | |
62- | ` options ` | options for dropdown | ` [{label, value, disabled}] ` | |
63- | ` value ` | pre-selected rows | ` [{label, value}] ` | ` [] ` |
64- | ` focusSearchOnOpen ` | focus on search input when opening | ` boolean ` | ` true ` |
65- | ` hasSelectAll ` | toggle 'Select All' option | ` boolean ` | ` true ` |
66- | ` isLoading ` | show spinner on select | ` boolean ` | ` false ` |
67- | ` shouldToggleOnHover ` | toggle dropdown on hover option | ` boolean ` | ` false ` |
68- | ` overrideStrings ` | i18n [ docs] ( #-internationalization ) | ` object ` | |
69- | ` onChange ` | onChange callback | ` function ` | |
70- | ` disabled ` | disable dropdown | ` boolean ` | ` false ` |
71- | ` selectAllLabel ` | _ select all_ label | ` string ` | |
72- | ` disableSearch ` | hide search textbox | ` boolean ` | ` false ` |
73- | ` filterOptions ` | custom filter options | ` function ` | Fuzzy Search |
74- | ` className ` | class name for parent component | ` string ` | ` multi-select ` |
75-
76- ### 🔍 Custom filter logic
59+ | Prop | Description | Type | Default |
60+ | --------------------- | ------------------------------------------------------ | ---------------------------- | -------------- |
61+ | ` labelledBy ` | value for ` aria-labelledby ` | ` string ` | |
62+ | ` options ` | options for dropdown | ` [{label, value, disabled}] ` | |
63+ | ` value ` | pre-selected rows | ` [{label, value}] ` | ` [] ` |
64+ | ` focusSearchOnOpen ` | focus on search input when opening | ` boolean ` | ` true ` |
65+ | ` hasSelectAll ` | toggle 'Select All' option | ` boolean ` | ` true ` |
66+ | ` isLoading ` | show spinner on select | ` boolean ` | ` false ` |
67+ | ` shouldToggleOnHover ` | toggle dropdown on hover option | ` boolean ` | ` false ` |
68+ | ` overrideStrings ` | i18n [ docs] ( #-internationalization ) | ` object ` | |
69+ | ` onChange ` | onChange callback | ` function ` | |
70+ | ` disabled ` | disable dropdown | ` boolean ` | ` false ` |
71+ | ` selectAllLabel ` | _ select all_ label | ` string ` | |
72+ | ` disableSearch ` | hide search textbox | ` boolean ` | ` false ` |
73+ | ` filterOptions ` | custom filter options | ` function ` | Fuzzy Search |
74+ | ` className ` | class name for parent component | ` string ` | ` multi-select ` |
75+ | ` valueRenderer ` | custom dropdown header [ docs] ( #-custom-value-renderer ) | ` function ` | |
76+ | ` ItemRenderer ` | custom dropdown option [ docs] ( #-custom-item-renderer ) | ` function ` | |
77+
78+ ## 🔍 Custom filter logic
7779
7880By default this component uses a fuzzy search algorithm to filter options but also allows you to opt-out and use your custom logic if you want to below is the example doing just case insensitive search
7981
@@ -102,6 +104,24 @@ default values for `overrideStrings` are as below
102104}
103105```
104106
107+ ## 🎛 Custom Value Renderer
108+
109+ Optionally customise value renderer view by passing ` valueRenderer ` prop
110+
111+ ``` js
112+ const customValueRenderer = (selected , _options ) => {
113+ return selected .length
114+ ? selected .map (({ label }) => " ✔️ " + label)
115+ : " 😶 No Items Selected" ;
116+ };
117+ ```
118+
119+ ## 🎛 Custom Item Renderer
120+
121+ Optionally customise dropdown item by passing ` ItemRenderer ` prop
122+
123+ [ Default Item Renderer] ( https://github.com/harshzalavadiya/react-multi-select-component/blob/master/src/select-panel/default-item.tsx#L27-L47 )
124+
105125## 💅 Themeing
106126
107127You can override CSS variables to customize the appearance
0 commit comments