@rhc-shared-components/rich-text-editor
v0.7.0
Published
WYSWYG Editor for Red Hat Certified Apps
Downloads
31
Keywords
Readme
@rhc-shared-components/rich-text-editor
WYSWYG Editor for Red Hat Certified Apps
Install
yarn add @rhc-shared-components/rich-text-editor
Usage
import React from 'react';
import { RichTextEditorFormComponent, RichTextEditor } from '@rhc-shared-components/rich-text-editor';
import { Formik } from 'formik';
import { Title } from "@patternfly/react-core";
const App = () => {
const FieldName = 'richtext';
return (
<div>
<Title headingLevel={'h1'}>RichTextEditor</Title>
<RichTextEditor value={"<h3>hello world from normal RTE</h3>"}/>
<Title headingLevel={'h1'}>RichTextEditor with formik</Title>
<Formik
initialValues={{
[FieldName]: '<h1>Hello world</h1>'
}}
enableReinitialize={true}
onSubmit={()=>{}}>
<RichTextEditorFormComponent
name={FieldName}
label={'Rich text form label'}
helperText={'This is a test description'}
isRequired={true}
/>
</Formik>
</div>);
}
License
MIT © gautamkrishnar