import React from 'react'; import { SearchInput } from '@patternfly/react-core'; export const SearchInputWithExpandable: React.FunctionComponent = () => { const [value, setValue] = React.useState(''); const [isExpanded, setIsExpanded] = React.useState(false); const onChange = (value: string) => { setValue(value); }; const onToggleExpand = (_event: React.SyntheticEvent, isExpanded: boolean) => { setIsExpanded(!isExpanded); }; return ( onChange(value)} onClear={() => onChange('')} expandableInput={{ isExpanded, onToggleExpand, toggleAriaLabel: 'Expandable search input toggle' }} /> ); };