Debian Codegraph @

node/@patternfly/react-core/src/components/SearchInput/examples/SearchInputWithSubmitButton.tsx

raw
1 import { useState } from 'react';
2 import { SearchInput } from '@patternfly/react-core';
3
4 export const SearchInputWithSubmitButton: React.FunctionComponent = () => {
5 const [value, setValue] = useState('');
6
7 return (
8 <SearchInput
9 aria-label="Search with submit button example"
10 placeholder="Find by name"
11 value={value}
12 onChange={(_event, value) => setValue(value)}
13 onSearch={(_event, value) => setValue(value)}
14 onClear={() => setValue('')}
15 />
16 );
17 };