Debian Codegraph @

node/@patternfly/react-core/src/components/TextArea/examples/TextAreaReadOnly.tsx

raw
1 import { Fragment, useState } from 'react';
2 import { Checkbox, TextArea } from '@patternfly/react-core';
3
4 export const TextAreaReadOnly: React.FunctionComponent = () => {
5 const [isPlainChecked, setIsPlainChecked] = useState(false);
6
7 return (
8 <Fragment>
9 <div style={{ marginBottom: '12px' }}>
10 <Checkbox
11 id="isPlain"
12 key="isPlain"
13 label="Plain read only variant"
14 isChecked={isPlainChecked}
15 onChange={(_event, checked) => setIsPlainChecked(checked)}
16 />
17 </div>
18 <TextArea
19 aria-label="read only text area example"
20 value="read only text area example"
21 readOnlyVariant={isPlainChecked ? 'plain' : 'default'}
22 />
23 </Fragment>
24 );
25 };