Debian Codegraph @

node/@patternfly/react-core/src/components/TextInput/examples/TextInputCustomIcon.tsx

raw
1 import { useState } from 'react';
2 import { TextInput } from '@patternfly/react-core';
3 import RhUiCalendarFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-calendar-fill-icon';
4 import RhUiClockFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-clock-fill-icon';
5
6 export const TextInputCustomIcon: React.FunctionComponent = () => {
7 const [calendar, setCalendar] = useState('');
8 const [clock, setClock] = useState('');
9
10 return (
11 <>
12 <TextInput
13 value={calendar}
14 type="text"
15 customIcon={<RhUiCalendarFillIcon />}
16 onChange={(_event, value) => setCalendar(value)}
17 aria-label="text input example with calendar icon"
18 />
19 <br />
20 <br />
21 <TextInput
22 value={clock}
23 type="text"
24 customIcon={<RhUiClockFillIcon />}
25 onChange={(_event, value) => setClock(value)}
26 aria-label="text input example with clock icon"
27 />
28 </>
29 );
30 };