Textarea
Description
the /TextArea
folder export three main variants of the Text areas:
- Raw or normal:the default component exported from the Textarea folder
import TextArea from '@/components/primitives/TextArea
;
- Rich text [WYSIWYG] : a wrapper on top of the tinymce (opens in a new tab)
import {RichTextEditor} from '@/components/primitives/TextArea
; - IDE or Code Editor: a wrapper on top of @monaco-editor (opens in a new tab)
import {CodeEditor} from '@/components/primitives/TextArea
;
Raw
Default
<TextArea placeholder="content goes here" />
Disabled
<TextArea placeholder="content goes here" isDisabled={true} size="medium" />
Sizes
Xlarge
<TextArea placeholder="content goes here" size="xlarge" />
large
medium
small
xsmall
auto
Rich Text Editor [ WYSIWYG]
Default
<RichTextEditor initialValue="Initial value" />
Demo :
<RichTextEditor
initialValue="initial value"
onEditorChange={input => {
setContent(input);
}}
/>
Disabled
<RichTextEditor isDisabled={true} />
Code Editor [IDE]
Default
Loading...
<CodeEditor
defaultValue="// default value"
size="xlarge"
defaultLanguage="javascript"
/>
language
Loading...
<CodeEditor size="xlarge" defaultLanguage="html" />
Demo
Loading...
<CodeEditor
language="javascript"
onChange={input => {
setContent(input);
}}
/>
Disabled
Loading...
<CodeEditor size="xlarge" defaultLanguage="html" isDisabled={true} / />
Extensive list of props:
Automated tests
Unit
Command : npm run test:unit
Test file location : /tests/textarea.unit.test.tsx
npm run test:unit:file textarea
Integration
Command : ???
Test file location : ???
???