Debian Codegraph @

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

raw
1 import { useState } from 'react';
2 import { TextInput, ValidatedOptions } from '@patternfly/react-core';
3 import RhUiCalendarFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-calendar-fill-icon';
4
5 export const TextInputCustomIconInvalid: React.FunctionComponent = () => {
6 const [calendar, setCalendar] = useState('');
7
8 return (
9 <>
10 <TextInput
11 value={calendar}
12 type="text"
13 validated={ValidatedOptions.error}
14 customIcon={<RhUiCalendarFillIcon />}
15 onChange={(_event, value) => setCalendar(value)}
16 aria-label="text input example with calendar icon"
17 />
18 </>
19 );
20 };