| 1 |
--- |
| 2 |
id: Context selector |
| 3 |
section: components |
| 4 |
subsection: menus |
| 5 |
source: react-demos |
| 6 |
propComponents: |
| 7 |
[ |
| 8 |
'MenuToggle', |
| 9 |
'MenuFooter', |
| 10 |
'MenuSearch', |
| 11 |
'MenuSearchInput', |
| 12 |
'Divider', |
| 13 |
'InputGroup', |
| 14 |
'SearchInput', |
| 15 |
'Dropdown', |
| 16 |
'DropdownGroup', |
| 17 |
'DropdownList', |
| 18 |
'DropdownItem' |
| 19 |
] |
| 20 |
--- |
| 21 |
|
| 22 |
import { useRef, useState } from 'react'; |
| 23 |
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon'; |
| 24 |
|
| 25 |
As the context selector component is now deprecated, a context selector may now be built using the new suite of menu components. This is showcased in the following demo, which uses the new [dropdown](/components/menus/dropdown) component that is built off of menu. |
| 26 |
|
| 27 |
### Context selector menu |
| 28 |
|
| 29 |
```ts file="./examples/ContextSelectorDemo.tsx" |
| 30 |
|
| 31 |
``` |